├── LICENSE ├── README.md ├── assets ├── css │ └── custom-urm-styles.css └── js │ └── custom-urm-scripts.js ├── classes └── class-custom-urm-logs-table.php ├── composer.json ├── composer.lock ├── custom-update-request-modifier.php ├── languages ├── custom-urm-es_MX.mo ├── custom-urm-es_MX.po ├── custom-urm-fr_FR.mo ├── custom-urm-fr_FR.po ├── custom-urm-it_IT.mo ├── custom-urm-it_IT.po └── custom-urm.pot └── vendor ├── autoload.php ├── composer ├── ClassLoader.php ├── InstalledVersions.php ├── LICENSE ├── autoload_classmap.php ├── autoload_namespaces.php ├── autoload_psr4.php ├── autoload_real.php ├── autoload_static.php ├── installed.json ├── installed.php └── platform_check.php ├── plugin-update-checker ├── Puc │ ├── v5 │ │ └── PucFactory.php │ └── v5p4 │ │ ├── Autoloader.php │ │ ├── DebugBar │ │ ├── Extension.php │ │ ├── Panel.php │ │ ├── PluginExtension.php │ │ ├── PluginPanel.php │ │ └── ThemePanel.php │ │ ├── InstalledPackage.php │ │ ├── Metadata.php │ │ ├── OAuthSignature.php │ │ ├── Plugin │ │ ├── Package.php │ │ ├── PluginInfo.php │ │ ├── Ui.php │ │ ├── Update.php │ │ └── UpdateChecker.php │ │ ├── PucFactory.php │ │ ├── Scheduler.php │ │ ├── StateStore.php │ │ ├── Theme │ │ ├── Package.php │ │ ├── Update.php │ │ └── UpdateChecker.php │ │ ├── Update.php │ │ ├── UpdateChecker.php │ │ ├── UpgraderStatus.php │ │ ├── Utils.php │ │ ├── Vcs │ │ ├── Api.php │ │ ├── BaseChecker.php │ │ ├── BitBucketApi.php │ │ ├── GitHubApi.php │ │ ├── GitLabApi.php │ │ ├── PluginUpdateChecker.php │ │ ├── Reference.php │ │ ├── ReleaseAssetSupport.php │ │ ├── ReleaseFilteringFeature.php │ │ ├── ThemeUpdateChecker.php │ │ └── VcsCheckerMethods.php │ │ └── WpCliCheckTrigger.php ├── README.md ├── composer.json ├── css │ └── puc-debug-bar.css ├── js │ └── debug-bar.js ├── languages │ ├── plugin-update-checker-ca.mo │ ├── plugin-update-checker-ca.po │ ├── plugin-update-checker-cs_CZ.mo │ ├── plugin-update-checker-cs_CZ.po │ ├── plugin-update-checker-da_DK.mo │ ├── plugin-update-checker-da_DK.po │ ├── plugin-update-checker-de_DE.mo │ ├── plugin-update-checker-de_DE.po │ ├── plugin-update-checker-es_AR.mo │ ├── plugin-update-checker-es_AR.po │ ├── plugin-update-checker-es_CL.mo │ ├── plugin-update-checker-es_CL.po │ ├── plugin-update-checker-es_CO.mo │ ├── plugin-update-checker-es_CO.po │ ├── plugin-update-checker-es_CR.mo │ ├── plugin-update-checker-es_CR.po │ ├── plugin-update-checker-es_DO.mo │ ├── plugin-update-checker-es_DO.po │ ├── plugin-update-checker-es_ES.mo │ ├── plugin-update-checker-es_ES.po │ ├── plugin-update-checker-es_GT.mo │ ├── plugin-update-checker-es_GT.po │ ├── plugin-update-checker-es_HN.mo │ ├── plugin-update-checker-es_HN.po │ ├── plugin-update-checker-es_MX.mo │ ├── plugin-update-checker-es_MX.po │ ├── plugin-update-checker-es_PE.mo │ ├── plugin-update-checker-es_PE.po │ ├── plugin-update-checker-es_PR.mo │ ├── plugin-update-checker-es_PR.po │ ├── plugin-update-checker-es_UY.mo │ ├── plugin-update-checker-es_UY.po │ ├── plugin-update-checker-es_VE.mo │ ├── plugin-update-checker-es_VE.po │ ├── plugin-update-checker-fa_IR.mo │ ├── plugin-update-checker-fa_IR.po │ ├── plugin-update-checker-fr_CA.mo │ ├── plugin-update-checker-fr_CA.po │ ├── plugin-update-checker-fr_FR.mo │ ├── plugin-update-checker-fr_FR.po │ ├── plugin-update-checker-hu_HU.mo │ ├── plugin-update-checker-hu_HU.po │ ├── plugin-update-checker-it_IT.mo │ ├── plugin-update-checker-it_IT.po │ ├── plugin-update-checker-ja.mo │ ├── plugin-update-checker-ja.po │ ├── plugin-update-checker-nl_BE.mo │ ├── plugin-update-checker-nl_BE.po │ ├── plugin-update-checker-nl_NL.mo │ ├── plugin-update-checker-nl_NL.po │ ├── plugin-update-checker-pt_BR.mo │ ├── plugin-update-checker-pt_BR.po │ ├── plugin-update-checker-ru_RU.mo │ ├── plugin-update-checker-ru_RU.po │ ├── plugin-update-checker-sl_SI.mo │ ├── plugin-update-checker-sl_SI.po │ ├── plugin-update-checker-sv_SE.mo │ ├── plugin-update-checker-sv_SE.po │ ├── plugin-update-checker-tr_TR.mo │ ├── plugin-update-checker-tr_TR.po │ ├── plugin-update-checker-uk_UA.mo │ ├── plugin-update-checker-uk_UA.po │ ├── plugin-update-checker-zh_CN.mo │ ├── plugin-update-checker-zh_CN.po │ └── plugin-update-checker.pot ├── license.txt ├── load-v5p4.php ├── plugin-update-checker.php └── vendor │ ├── Parsedown.php │ ├── ParsedownModern.php │ └── PucReadmeParser.php └── robertdevore └── wpcom-check ├── LICENSE ├── README.md ├── composer.json └── src └── WPComPluginHandler.php /README.md: -------------------------------------------------------------------------------- 1 | # Custom Update Request Modifier 2 | 3 | This free plugin for WordPress® modifies HTTP request user-agent strings for themes, plugins, core updates, and other WordPress API requests. 4 | 5 | It offers custom API URL configuration, logs request details including headers and body, and excludes plugins and themes with a custom `Update URI` in their headers from update checks. 6 | 7 | ## Features 8 | - Modify user-agent strings for specific HTTP requests to replace the site URL with WordPress.org. 9 | - Configure custom API URLs for monitoring HTTP requests. 10 | - Log request headers, body, and response status codes in a custom database table. 11 | - Exclude plugins and themes with a specified `Update URI` header from update checks. 12 | - Supports separate update checks for plugins and themes. 13 | 14 | ## Installation 15 | 1. Clone or download the plugin to your `wp-content/plugins` directory. 16 | 2. Activate the plugin through the WordPress admin dashboard under **Plugins**. 17 | 3. Upon activation, the plugin creates a custom logging table in the database for tracking requests and schedules daily log clearing. 18 | 19 | ## Usage 20 | ### Request Modification 21 | Once activated, the plugin intercepts HTTP requests to specific WordPress API endpoints and modifies the `user-agent` header by replacing the site's URL with `wordpress.org`. This modified header allows certain requests to appear as if they are originating from WordPress.org. 22 | 23 | ### Exclusion of Plugins and Themes 24 | The plugin inspects the HTTP request body for plugin and theme update checks and automatically excludes items with a specified `Update URI` header. This can be useful for avoiding update checks for plugins or themes hosted outside the WordPress.org repository. 25 | 26 | ### API URL Monitoring 27 | The plugin allows you to add custom API URLs in the settings for monitoring. Requests to these URLs will be logged, enabling detailed monitoring of specific update requests. 28 | 29 | ## Settings 30 | Access the plugin settings under **Settings > Custom URM** in the WordPress admin dashboard. The settings page has two tabs: 31 | 1. **API URLs**: Add or remove custom API URLs for request monitoring. Each entry here is a URL that, when matched in a request, will trigger logging. 32 | 2. **Logs**: View logs of monitored HTTP requests, including details like headers and request bodies. 33 | 34 | ### Adding API URLs 35 | - Add new URLs in the **API URLs** tab to monitor additional endpoints. 36 | - URLs added here will be automatically checked against each HTTP request. 37 | 38 | ### Clearing Logs 39 | - The logs tab allows clearing of log data, which can be done manually or will automatically clear daily. 40 | 41 | ## Filters 42 | 43 | The plugin includes filters to customize various aspects of its functionality. 44 | 45 | ### User-Agent String Replacement 46 | 47 | - **`custom_urm_user_agent_string_replace`**: Modifies the replacement value in the user-agent string. 48 | 49 | Example usage: 50 | 51 | ```php 52 | add_filter( 'custom_urm_user_agent_string_replace', function() { 53 | return 'notmatt.press'; 54 | } ); 55 | ``` 56 | 57 | ### Core Parameters for Update Checks 58 | 59 | - **`custom_urm_allowed_core_params`**: Customizes the list of allowed parameters in the WordPress core update request. 60 | 61 | Example usage: 62 | 63 | ```php 64 | add_filter( 'custom_urm_allowed_core_params', function( $params ) { 65 | // Add a new parameter. 66 | $params[] = 'new_param'; 67 | 68 | // Remove an existing parameter. 69 | $params = array_diff( $params, [ 'mysql' ] ); 70 | 71 | return $params; 72 | } ); 73 | ``` 74 | 75 | Use `custom_urm_allowed_core_params` to control which parameters are included in the core update check request, allowing for fine-grained customization. -------------------------------------------------------------------------------- /assets/css/custom-urm-styles.css: -------------------------------------------------------------------------------- 1 | .custom-urm-modal { 2 | display: none; 3 | position: fixed; 4 | z-index: 9999; 5 | left: 0; 6 | top: 0; 7 | width: 100%; 8 | height: 100%; 9 | overflow: auto; 10 | background-color: rgba(0,0,0,0.4); 11 | } 12 | 13 | .custom-urm-modal-content { 14 | background-color: #fefefe; 15 | margin: 10% auto; 16 | padding: 20px; 17 | border: 1px solid #888; 18 | width: 80%; 19 | max-height: 70%; 20 | overflow-y: auto; 21 | } 22 | 23 | .custom-urm-close { 24 | color: #aaa; 25 | float: right; 26 | font-size: 28px; 27 | font-weight: bold; 28 | cursor: pointer; 29 | } 30 | 31 | .custom-urm-close:hover, 32 | .custom-urm-close:focus { 33 | color: black; 34 | text-decoration: none; 35 | } 36 | 37 | pre { 38 | white-space: pre-wrap; 39 | word-wrap: break-word; 40 | } 41 | 42 | #api-urls-table input[type="text"] { 43 | width: 100% !important; 44 | } 45 | 46 | #api-urls-table td { 47 | padding: 15px 20px 15px 0 48 | } -------------------------------------------------------------------------------- /assets/js/custom-urm-scripts.js: -------------------------------------------------------------------------------- 1 | document.addEventListener( "DOMContentLoaded", function() { 2 | // Function to open modal 3 | function openModal(modalId) { 4 | var modal = document.getElementById(modalId); 5 | if (modal) { 6 | modal.style.display = "block"; 7 | } 8 | } 9 | 10 | // Function to close modal 11 | function closeModal(modalId) { 12 | var modal = document.getElementById(modalId); 13 | if (modal) { 14 | modal.style.display = "none"; 15 | } 16 | } 17 | 18 | // Add event listeners to Show buttons 19 | var showButtons = document.querySelectorAll(".show-modal"); 20 | showButtons.forEach(function(button) { 21 | button.addEventListener("click", function() { 22 | var modalId = this.getAttribute("data-modal"); 23 | openModal(modalId); 24 | }); 25 | }); 26 | 27 | // Add event listeners to Close buttons 28 | var closeButtons = document.querySelectorAll(".custom-urm-close"); 29 | closeButtons.forEach(function(span) { 30 | span.addEventListener("click", function() { 31 | var modalId = this.getAttribute("data-modal"); 32 | closeModal(modalId); 33 | }); 34 | }); 35 | 36 | // Add event listener to close modal when clicking outside the modal content 37 | window.addEventListener("click", function(event) { 38 | if (event.target.classList.contains("custom-urm-modal")) { 39 | event.target.style.display = "none"; 40 | } 41 | }); 42 | }); 43 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "robertdevore/wpcom-check": "^1.0" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "455764cd9b78270c5af3fb1bf25af96e", 8 | "packages": [ 9 | { 10 | "name": "robertdevore/wpcom-check", 11 | "version": "1.0.1", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/robertdevore/wpcom-check.git", 15 | "reference": "25eb61d7e0fbd4b2a87a81c3fa7dca722f8d8058" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/robertdevore/wpcom-check/zipball/25eb61d7e0fbd4b2a87a81c3fa7dca722f8d8058", 20 | "reference": "25eb61d7e0fbd4b2a87a81c3fa7dca722f8d8058", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "php": ">=7.4" 25 | }, 26 | "type": "library", 27 | "extra": { 28 | "wordpress-plugin": true 29 | }, 30 | "autoload": { 31 | "psr-4": { 32 | "RobertDevore\\WPComCheck\\": "src/" 33 | } 34 | }, 35 | "notification-url": "https://packagist.org/downloads/", 36 | "license": [ 37 | "MIT" 38 | ], 39 | "authors": [ 40 | { 41 | "name": "Robert DeVore", 42 | "email": "me@robertdevore.com", 43 | "homepage": "https://github.com/robertdevore", 44 | "role": "Developer" 45 | } 46 | ], 47 | "description": "A utility to handle WordPress.com-specific plugin compatibility and auto-deactivation.", 48 | "homepage": "https://github.com/robertdevore/wpcom-check", 49 | "keywords": [ 50 | "compatibility", 51 | "deactivation", 52 | "plugin", 53 | "wordpress", 54 | "wordpress.com" 55 | ], 56 | "support": { 57 | "issues": "https://github.com/robertdevore/wpcom-check/issues", 58 | "source": "https://github.com/robertdevore/wpcom-check/tree/1.0.1" 59 | }, 60 | "time": "2025-01-07T17:17:53+00:00" 61 | } 62 | ], 63 | "packages-dev": [], 64 | "aliases": [], 65 | "minimum-stability": "stable", 66 | "stability-flags": {}, 67 | "prefer-stable": false, 68 | "prefer-lowest": false, 69 | "platform": {}, 70 | "platform-dev": {}, 71 | "plugin-api-version": "2.6.0" 72 | } 73 | -------------------------------------------------------------------------------- /languages/custom-urm-es_MX.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertdevore/custom-update-request-modifier/a8ec4ca9543b54a495f3da44abd9a2ce2e388e1b/languages/custom-urm-es_MX.mo -------------------------------------------------------------------------------- /languages/custom-urm-es_MX.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: Custom Update Request Modifier\n" 4 | "POT-Creation-Date: 2025-02-04 14:11-0500\n" 5 | "PO-Revision-Date: 2025-02-04 14:14-0500\n" 6 | "Last-Translator: \n" 7 | "Language-Team: \n" 8 | "Language: es_MX\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Generator: Poedit 3.5\n" 13 | "X-Poedit-Basepath: ..\n" 14 | "X-Poedit-Flags-xgettext: --add-comments=translators:\n" 15 | "X-Poedit-WPHeader: custom-update-request-modifier.php\n" 16 | "X-Poedit-SourceCharset: UTF-8\n" 17 | "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" 18 | "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;" 19 | "_nx_noop:3c,1,2;__ngettext_noop:1,2\n" 20 | "X-Poedit-SearchPath-0: .\n" 21 | "X-Poedit-SearchPathExcluded-0: *.min.js\n" 22 | "X-Poedit-SearchPathExcluded-1: vendor\n" 23 | 24 | #: classes/class-custom-urm-logs-table.php:28 25 | msgid "Log" 26 | msgstr "Registro" 27 | 28 | #: classes/class-custom-urm-logs-table.php:29 29 | #: custom-update-request-modifier.php:252 30 | msgid "Logs" 31 | msgstr "Bitácoras de usuario" 32 | 33 | #: classes/class-custom-urm-logs-table.php:100 34 | msgid "Time" 35 | msgstr "Hora" 36 | 37 | #: classes/class-custom-urm-logs-table.php:101 38 | msgid "URL" 39 | msgstr "URL" 40 | 41 | #: classes/class-custom-urm-logs-table.php:102 42 | msgid "User Agent" 43 | msgstr "Agente de usuario" 44 | 45 | #: classes/class-custom-urm-logs-table.php:103 46 | #: classes/class-custom-urm-logs-table.php:233 47 | msgid "Request Headers" 48 | msgstr "Encabezados de solicitud" 49 | 50 | #: classes/class-custom-urm-logs-table.php:104 51 | #: classes/class-custom-urm-logs-table.php:243 52 | msgid "Request Body" 53 | msgstr "Cuerpo de la solicitud" 54 | 55 | #: classes/class-custom-urm-logs-table.php:105 56 | msgid "Response Code" 57 | msgstr "Código de respuesta" 58 | 59 | #: classes/class-custom-urm-logs-table.php:172 60 | #: classes/class-custom-urm-logs-table.php:175 61 | msgid "Show" 62 | msgstr "Mostrar" 63 | 64 | #: classes/class-custom-urm-logs-table.php:201 65 | msgid "No logs found." 66 | msgstr "No se han encontrado registros." 67 | 68 | #: custom-update-request-modifier.php:182 69 | msgid "Custom URM Settings" 70 | msgstr "Configuración URM personalizada" 71 | 72 | #: custom-update-request-modifier.php:183 73 | msgid "Custom URM" 74 | msgstr "URM a medida" 75 | 76 | #: custom-update-request-modifier.php:211 77 | msgid "Nonce verification failed." 78 | msgstr "La verificación ha fallado." 79 | 80 | #: custom-update-request-modifier.php:227 81 | msgid "All logs have been cleared successfully." 82 | msgstr "Todos los registros se han borrado correctamente." 83 | 84 | #: custom-update-request-modifier.php:233 85 | msgid "Custom Update Request Modifier Settings" 86 | msgstr "" 87 | "Configuración personalizada del modificador de solicitud de actualización" 88 | 89 | #: custom-update-request-modifier.php:239 90 | msgid "Are you sure you want to clear all logs?" 91 | msgstr "¿Estás seguro de que quieres borrar todos los registros?" 92 | 93 | #: custom-update-request-modifier.php:240 94 | msgid "Clear Logs" 95 | msgstr "Limpiar Logs" 96 | 97 | #: custom-update-request-modifier.php:249 98 | #: custom-update-request-modifier.php:264 99 | msgid "API URLs" 100 | msgstr "URL de API" 101 | 102 | #: custom-update-request-modifier.php:265 103 | msgid "" 104 | "Add or remove API URLs whose HTTP requests will be modified and logged for " 105 | "monitoring purposes." 106 | msgstr "" 107 | "Añada o elimine URL de API cuyas solicitudes HTTP se modificarán y " 108 | "registrarán con fines de supervisión." 109 | 110 | #: custom-update-request-modifier.php:272 111 | #: custom-update-request-modifier.php:302 112 | msgid "Remove" 113 | msgstr "Eliminar" 114 | 115 | #: custom-update-request-modifier.php:278 116 | msgid "Add URL" 117 | msgstr "Añadir URL" 118 | 119 | #: custom-update-request-modifier.php:279 120 | msgid "Save Changes" 121 | msgstr "Guardar Cambios" 122 | 123 | #: custom-update-request-modifier.php:290 124 | msgid "Search" 125 | msgstr "Buscar" 126 | 127 | #. Plugin Name of the plugin/theme 128 | msgid "Custom Update Request Modifier" 129 | msgstr "Modificador personalizado de solicitud de actualización" 130 | 131 | #. Plugin URI of the plugin/theme 132 | msgid "https://github.com/robertdevore/custom-update-request-modifier/" 133 | msgstr "https://github.com/robertdevore/custom-update-request-modifier/" 134 | 135 | #. Description of the plugin/theme 136 | msgid "" 137 | "Modifies the user-agent string in HTTP requests for theme, plugin, core, and " 138 | "other WordPress API requests. Allows custom API URL configuration, logs " 139 | "request details including headers and body, and excludes non-WordPress.org " 140 | "plugins from update checks." 141 | msgstr "" 142 | "Modifica la cadena de agente de usuario en las peticiones HTTP de temas, " 143 | "plugins, core y otras peticiones de la API de WordPress. Permite la " 144 | "configuración personalizada de la URL de la API, registra los detalles de la " 145 | "solicitud, incluidas las cabeceras y el cuerpo, y excluye los plugins que no " 146 | "son de WordPress.org de las comprobaciones de actualización." 147 | 148 | #. Author of the plugin/theme 149 | msgid "Robert DeVore" 150 | msgstr "Robert DeVore" 151 | 152 | #. Author URI of the plugin/theme 153 | msgid "https://robertdevore.com/" 154 | msgstr "https://robertdevore.com/" 155 | -------------------------------------------------------------------------------- /languages/custom-urm-fr_FR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertdevore/custom-update-request-modifier/a8ec4ca9543b54a495f3da44abd9a2ce2e388e1b/languages/custom-urm-fr_FR.mo -------------------------------------------------------------------------------- /languages/custom-urm-fr_FR.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: Custom Update Request Modifier\n" 4 | "POT-Creation-Date: 2025-02-04 14:14-0500\n" 5 | "PO-Revision-Date: 2025-02-04 14:15-0500\n" 6 | "Last-Translator: \n" 7 | "Language-Team: \n" 8 | "Language: fr_FR\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Generator: Poedit 3.5\n" 13 | "X-Poedit-Basepath: ..\n" 14 | "X-Poedit-Flags-xgettext: --add-comments=translators:\n" 15 | "X-Poedit-WPHeader: custom-update-request-modifier.php\n" 16 | "X-Poedit-SourceCharset: UTF-8\n" 17 | "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" 18 | "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;" 19 | "_nx_noop:3c,1,2;__ngettext_noop:1,2\n" 20 | "X-Poedit-SearchPath-0: .\n" 21 | "X-Poedit-SearchPathExcluded-0: *.min.js\n" 22 | "X-Poedit-SearchPathExcluded-1: vendor\n" 23 | 24 | #: classes/class-custom-urm-logs-table.php:28 25 | msgid "Log" 26 | msgstr "Journal" 27 | 28 | #: classes/class-custom-urm-logs-table.php:29 29 | #: custom-update-request-modifier.php:251 30 | msgid "Logs" 31 | msgstr "Journaux" 32 | 33 | #: classes/class-custom-urm-logs-table.php:100 34 | msgid "Time" 35 | msgstr "Heure" 36 | 37 | #: classes/class-custom-urm-logs-table.php:101 38 | msgid "URL" 39 | msgstr "URL" 40 | 41 | #: classes/class-custom-urm-logs-table.php:102 42 | msgid "User Agent" 43 | msgstr "Agent utilisateur" 44 | 45 | #: classes/class-custom-urm-logs-table.php:103 46 | #: classes/class-custom-urm-logs-table.php:233 47 | msgid "Request Headers" 48 | msgstr "En-têtes de requête" 49 | 50 | #: classes/class-custom-urm-logs-table.php:104 51 | #: classes/class-custom-urm-logs-table.php:243 52 | msgid "Request Body" 53 | msgstr "Corps de la demande" 54 | 55 | #: classes/class-custom-urm-logs-table.php:105 56 | msgid "Response Code" 57 | msgstr "Code de réponse" 58 | 59 | #: classes/class-custom-urm-logs-table.php:172 60 | #: classes/class-custom-urm-logs-table.php:175 61 | msgid "Show" 62 | msgstr "Afficher" 63 | 64 | #: classes/class-custom-urm-logs-table.php:201 65 | msgid "No logs found." 66 | msgstr "Aucun journal trouvé." 67 | 68 | #: custom-update-request-modifier.php:181 69 | msgid "Custom URM Settings" 70 | msgstr "Paramètres URM personnalisés" 71 | 72 | #: custom-update-request-modifier.php:182 73 | msgid "Custom URM" 74 | msgstr "URM personnalisé" 75 | 76 | #: custom-update-request-modifier.php:210 77 | msgid "Nonce verification failed." 78 | msgstr "Échec de la vérification." 79 | 80 | #: custom-update-request-modifier.php:226 81 | msgid "All logs have been cleared successfully." 82 | msgstr "Tous les journaux ont été effacés avec succès." 83 | 84 | #: custom-update-request-modifier.php:232 85 | msgid "Custom Update Request Modifier Settings" 86 | msgstr "Paramètres du modificateur de demande de mise à jour personnalisée" 87 | 88 | #: custom-update-request-modifier.php:238 89 | msgid "Are you sure you want to clear all logs?" 90 | msgstr "Êtes-vous sûr de vouloir effacer tous les journaux ?" 91 | 92 | #: custom-update-request-modifier.php:239 93 | msgid "Clear Logs" 94 | msgstr "Supprimer le journal d'erreurs" 95 | 96 | #: custom-update-request-modifier.php:248 97 | #: custom-update-request-modifier.php:263 98 | msgid "API URLs" 99 | msgstr "URLs API" 100 | 101 | #: custom-update-request-modifier.php:264 102 | msgid "" 103 | "Add or remove API URLs whose HTTP requests will be modified and logged for " 104 | "monitoring purposes." 105 | msgstr "" 106 | "Ajouter ou supprimer des URL d'API dont les requêtes HTTP seront modifiées " 107 | "et enregistrées à des fins de surveillance." 108 | 109 | #: custom-update-request-modifier.php:271 110 | #: custom-update-request-modifier.php:301 111 | msgid "Remove" 112 | msgstr "Supprimer" 113 | 114 | #: custom-update-request-modifier.php:277 115 | msgid "Add URL" 116 | msgstr "Ajouter URL" 117 | 118 | #: custom-update-request-modifier.php:278 119 | msgid "Save Changes" 120 | msgstr "Sauvegarder les changements" 121 | 122 | #: custom-update-request-modifier.php:289 123 | msgid "Search" 124 | msgstr "Rechercher" 125 | 126 | #. Plugin Name of the plugin/theme 127 | msgid "Custom Update Request Modifier" 128 | msgstr "Modificateur de demande de mise à jour personnalisée" 129 | 130 | #. Plugin URI of the plugin/theme 131 | msgid "https://github.com/robertdevore/custom-update-request-modifier/" 132 | msgstr "https://github.com/robertdevore/custom-update-request-modifier/" 133 | 134 | #. Description of the plugin/theme 135 | msgid "" 136 | "Modifies the user-agent string in HTTP requests for theme, plugin, core, and " 137 | "other WordPress API requests. Allows custom API URL configuration, logs " 138 | "request details including headers and body, and excludes non-WordPress.org " 139 | "plugins from update checks." 140 | msgstr "" 141 | "Modifie la chaîne du user-agent dans les requêtes HTTP pour les thèmes, les " 142 | "plugins, le noyau et d'autres requêtes de l'API WordPress. Permet la " 143 | "configuration d'URL API personnalisées, enregistre les détails des requêtes, " 144 | "y compris les en-têtes et le corps, et exclut les plugins non-WordPress.org " 145 | "des vérifications de mise à jour." 146 | 147 | #. Author of the plugin/theme 148 | msgid "Robert DeVore" 149 | msgstr "Robert DeVore" 150 | 151 | #. Author URI of the plugin/theme 152 | msgid "https://robertdevore.com/" 153 | msgstr "https://robertdevore.com/" 154 | -------------------------------------------------------------------------------- /languages/custom-urm-it_IT.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertdevore/custom-update-request-modifier/a8ec4ca9543b54a495f3da44abd9a2ce2e388e1b/languages/custom-urm-it_IT.mo -------------------------------------------------------------------------------- /languages/custom-urm-it_IT.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: Custom Update Request Modifier\n" 4 | "POT-Creation-Date: 2025-02-04 14:16-0500\n" 5 | "PO-Revision-Date: 2025-02-04 14:16-0500\n" 6 | "Last-Translator: \n" 7 | "Language-Team: \n" 8 | "Language: it_IT\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Generator: Poedit 3.5\n" 13 | "X-Poedit-Basepath: ..\n" 14 | "X-Poedit-Flags-xgettext: --add-comments=translators:\n" 15 | "X-Poedit-WPHeader: custom-update-request-modifier.php\n" 16 | "X-Poedit-SourceCharset: UTF-8\n" 17 | "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" 18 | "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;" 19 | "_nx_noop:3c,1,2;__ngettext_noop:1,2\n" 20 | "X-Poedit-SearchPath-0: .\n" 21 | "X-Poedit-SearchPathExcluded-0: *.min.js\n" 22 | "X-Poedit-SearchPathExcluded-1: vendor\n" 23 | 24 | #: classes/class-custom-urm-logs-table.php:28 25 | msgid "Log" 26 | msgstr "Registro" 27 | 28 | #: classes/class-custom-urm-logs-table.php:29 29 | #: custom-update-request-modifier.php:251 30 | msgid "Logs" 31 | msgstr "Registri" 32 | 33 | #: classes/class-custom-urm-logs-table.php:100 34 | msgid "Time" 35 | msgstr "Orario" 36 | 37 | #: classes/class-custom-urm-logs-table.php:101 38 | msgid "URL" 39 | msgstr "URL" 40 | 41 | #: classes/class-custom-urm-logs-table.php:102 42 | msgid "User Agent" 43 | msgstr "User Agent" 44 | 45 | #: classes/class-custom-urm-logs-table.php:103 46 | #: classes/class-custom-urm-logs-table.php:233 47 | msgid "Request Headers" 48 | msgstr "Richiedi intestazioni" 49 | 50 | #: classes/class-custom-urm-logs-table.php:104 51 | #: classes/class-custom-urm-logs-table.php:243 52 | msgid "Request Body" 53 | msgstr "Corpo della richiesta" 54 | 55 | #: classes/class-custom-urm-logs-table.php:105 56 | msgid "Response Code" 57 | msgstr "Codice di risposta" 58 | 59 | #: classes/class-custom-urm-logs-table.php:172 60 | #: classes/class-custom-urm-logs-table.php:175 61 | msgid "Show" 62 | msgstr "Mostra" 63 | 64 | #: classes/class-custom-urm-logs-table.php:201 65 | msgid "No logs found." 66 | msgstr "Nessun registro trovato." 67 | 68 | #: custom-update-request-modifier.php:181 69 | msgid "Custom URM Settings" 70 | msgstr "Impostazioni URM personalizzate" 71 | 72 | #: custom-update-request-modifier.php:182 73 | msgid "Custom URM" 74 | msgstr "URM personalizzato" 75 | 76 | #: custom-update-request-modifier.php:210 77 | msgid "Nonce verification failed." 78 | msgstr "La verifica nonce non è riuscita." 79 | 80 | #: custom-update-request-modifier.php:226 81 | msgid "All logs have been cleared successfully." 82 | msgstr "Tutti i registri sono stati cancellati con successo." 83 | 84 | #: custom-update-request-modifier.php:232 85 | msgid "Custom Update Request Modifier Settings" 86 | msgstr "" 87 | "Impostazioni del modificatore di richiesta di aggiornamento personalizzato" 88 | 89 | #: custom-update-request-modifier.php:238 90 | msgid "Are you sure you want to clear all logs?" 91 | msgstr "È sicuro di voler cancellare tutti i registri?" 92 | 93 | #: custom-update-request-modifier.php:239 94 | msgid "Clear Logs" 95 | msgstr "Pulisci logs" 96 | 97 | #: custom-update-request-modifier.php:248 98 | #: custom-update-request-modifier.php:263 99 | msgid "API URLs" 100 | msgstr "URL API" 101 | 102 | #: custom-update-request-modifier.php:264 103 | msgid "" 104 | "Add or remove API URLs whose HTTP requests will be modified and logged for " 105 | "monitoring purposes." 106 | msgstr "" 107 | "Aggiungere o rimuovere URL API le cui richieste HTTP saranno modificate e " 108 | "registrate a scopo di monitoraggio." 109 | 110 | #: custom-update-request-modifier.php:271 111 | #: custom-update-request-modifier.php:301 112 | msgid "Remove" 113 | msgstr "Rimuovi" 114 | 115 | #: custom-update-request-modifier.php:277 116 | msgid "Add URL" 117 | msgstr "Aggiungi URL" 118 | 119 | #: custom-update-request-modifier.php:278 120 | msgid "Save Changes" 121 | msgstr "Salva modifiche" 122 | 123 | #: custom-update-request-modifier.php:289 124 | msgid "Search" 125 | msgstr "Cerca" 126 | 127 | #. Plugin Name of the plugin/theme 128 | msgid "Custom Update Request Modifier" 129 | msgstr "Modificatore di richiesta di aggiornamento personalizzato" 130 | 131 | #. Plugin URI of the plugin/theme 132 | msgid "https://github.com/robertdevore/custom-update-request-modifier/" 133 | msgstr "https://github.com/robertdevore/custom-update-request-modifier/" 134 | 135 | #. Description of the plugin/theme 136 | msgid "" 137 | "Modifies the user-agent string in HTTP requests for theme, plugin, core, and " 138 | "other WordPress API requests. Allows custom API URL configuration, logs " 139 | "request details including headers and body, and excludes non-WordPress.org " 140 | "plugins from update checks." 141 | msgstr "" 142 | "Modifica la stringa dell'agente utente nelle richieste HTTP per temi, " 143 | "plugin, core e altre richieste API di WordPress. Consente la configurazione " 144 | "personalizzata dell'URL dell'API, registra i dettagli della richiesta, " 145 | "compresi intestazioni e corpo, ed esclude i plugin non WordPress.org dai " 146 | "controlli di aggiornamento." 147 | 148 | #. Author of the plugin/theme 149 | msgid "Robert DeVore" 150 | msgstr "Robert DeVore" 151 | 152 | #. Author URI of the plugin/theme 153 | msgid "https://robertdevore.com/" 154 | msgstr "https://robertdevore.com/" 155 | -------------------------------------------------------------------------------- /languages/custom-urm.pot: -------------------------------------------------------------------------------- 1 | #, fuzzy 2 | msgid "" 3 | msgstr "" 4 | "Project-Id-Version: Custom Update Request Modifier\n" 5 | "POT-Creation-Date: 2025-02-04 14:11-0500\n" 6 | "PO-Revision-Date: 2025-02-04 14:11-0500\n" 7 | "Last-Translator: \n" 8 | "Language-Team: \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 13 | "X-Generator: Poedit 3.5\n" 14 | "X-Poedit-Basepath: ..\n" 15 | "X-Poedit-Flags-xgettext: --add-comments=translators:\n" 16 | "X-Poedit-WPHeader: custom-update-request-modifier.php\n" 17 | "X-Poedit-SourceCharset: UTF-8\n" 18 | "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" 19 | "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;" 20 | "_nx_noop:3c,1,2;__ngettext_noop:1,2\n" 21 | "X-Poedit-SearchPath-0: .\n" 22 | "X-Poedit-SearchPathExcluded-0: *.min.js\n" 23 | "X-Poedit-SearchPathExcluded-1: vendor\n" 24 | 25 | #: classes/class-custom-urm-logs-table.php:28 26 | msgid "Log" 27 | msgstr "" 28 | 29 | #: classes/class-custom-urm-logs-table.php:29 30 | #: custom-update-request-modifier.php:252 31 | msgid "Logs" 32 | msgstr "" 33 | 34 | #: classes/class-custom-urm-logs-table.php:100 35 | msgid "Time" 36 | msgstr "" 37 | 38 | #: classes/class-custom-urm-logs-table.php:101 39 | msgid "URL" 40 | msgstr "" 41 | 42 | #: classes/class-custom-urm-logs-table.php:102 43 | msgid "User Agent" 44 | msgstr "" 45 | 46 | #: classes/class-custom-urm-logs-table.php:103 47 | #: classes/class-custom-urm-logs-table.php:233 48 | msgid "Request Headers" 49 | msgstr "" 50 | 51 | #: classes/class-custom-urm-logs-table.php:104 52 | #: classes/class-custom-urm-logs-table.php:243 53 | msgid "Request Body" 54 | msgstr "" 55 | 56 | #: classes/class-custom-urm-logs-table.php:105 57 | msgid "Response Code" 58 | msgstr "" 59 | 60 | #: classes/class-custom-urm-logs-table.php:172 61 | #: classes/class-custom-urm-logs-table.php:175 62 | msgid "Show" 63 | msgstr "" 64 | 65 | #: classes/class-custom-urm-logs-table.php:201 66 | msgid "No logs found." 67 | msgstr "" 68 | 69 | #: custom-update-request-modifier.php:182 70 | msgid "Custom URM Settings" 71 | msgstr "" 72 | 73 | #: custom-update-request-modifier.php:183 74 | msgid "Custom URM" 75 | msgstr "" 76 | 77 | #: custom-update-request-modifier.php:211 78 | msgid "Nonce verification failed." 79 | msgstr "" 80 | 81 | #: custom-update-request-modifier.php:227 82 | msgid "All logs have been cleared successfully." 83 | msgstr "" 84 | 85 | #: custom-update-request-modifier.php:233 86 | msgid "Custom Update Request Modifier Settings" 87 | msgstr "" 88 | 89 | #: custom-update-request-modifier.php:239 90 | msgid "Are you sure you want to clear all logs?" 91 | msgstr "" 92 | 93 | #: custom-update-request-modifier.php:240 94 | msgid "Clear Logs" 95 | msgstr "" 96 | 97 | #: custom-update-request-modifier.php:249 98 | #: custom-update-request-modifier.php:264 99 | msgid "API URLs" 100 | msgstr "" 101 | 102 | #: custom-update-request-modifier.php:265 103 | msgid "" 104 | "Add or remove API URLs whose HTTP requests will be modified and logged for " 105 | "monitoring purposes." 106 | msgstr "" 107 | 108 | #: custom-update-request-modifier.php:272 109 | #: custom-update-request-modifier.php:302 110 | msgid "Remove" 111 | msgstr "" 112 | 113 | #: custom-update-request-modifier.php:278 114 | msgid "Add URL" 115 | msgstr "" 116 | 117 | #: custom-update-request-modifier.php:279 118 | msgid "Save Changes" 119 | msgstr "" 120 | 121 | #: custom-update-request-modifier.php:290 122 | msgid "Search" 123 | msgstr "" 124 | 125 | #. Plugin Name of the plugin/theme 126 | msgid "Custom Update Request Modifier" 127 | msgstr "" 128 | 129 | #. Plugin URI of the plugin/theme 130 | msgid "https://github.com/robertdevore/custom-update-request-modifier/" 131 | msgstr "" 132 | 133 | #. Description of the plugin/theme 134 | msgid "" 135 | "Modifies the user-agent string in HTTP requests for theme, plugin, core, and " 136 | "other WordPress API requests. Allows custom API URL configuration, logs " 137 | "request details including headers and body, and excludes non-WordPress.org " 138 | "plugins from update checks." 139 | msgstr "" 140 | 141 | #. Author of the plugin/theme 142 | msgid "Robert DeVore" 143 | msgstr "" 144 | 145 | #. Author URI of the plugin/theme 146 | msgid "https://robertdevore.com/" 147 | msgstr "" 148 | -------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/composer/InstalledVersions.php', 10 | ); 11 | -------------------------------------------------------------------------------- /vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/robertdevore/wpcom-check/src'), 10 | ); 11 | -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | register(true); 35 | 36 | return $loader; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/composer/autoload_static.php: -------------------------------------------------------------------------------- 1 | 11 | array ( 12 | 'RobertDevore\\WPComCheck\\' => 24, 13 | ), 14 | ); 15 | 16 | public static $prefixDirsPsr4 = array ( 17 | 'RobertDevore\\WPComCheck\\' => 18 | array ( 19 | 0 => __DIR__ . '/..' . '/robertdevore/wpcom-check/src', 20 | ), 21 | ); 22 | 23 | public static $classMap = array ( 24 | 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 25 | ); 26 | 27 | public static function getInitializer(ClassLoader $loader) 28 | { 29 | return \Closure::bind(function () use ($loader) { 30 | $loader->prefixLengthsPsr4 = ComposerStaticInitca9049066c1270338606f5739f59d5ab::$prefixLengthsPsr4; 31 | $loader->prefixDirsPsr4 = ComposerStaticInitca9049066c1270338606f5739f59d5ab::$prefixDirsPsr4; 32 | $loader->classMap = ComposerStaticInitca9049066c1270338606f5739f59d5ab::$classMap; 33 | 34 | }, null, ClassLoader::class); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/composer/installed.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | { 4 | "name": "robertdevore/wpcom-check", 5 | "version": "1.0.1", 6 | "version_normalized": "1.0.1.0", 7 | "source": { 8 | "type": "git", 9 | "url": "https://github.com/robertdevore/wpcom-check.git", 10 | "reference": "25eb61d7e0fbd4b2a87a81c3fa7dca722f8d8058" 11 | }, 12 | "dist": { 13 | "type": "zip", 14 | "url": "https://api.github.com/repos/robertdevore/wpcom-check/zipball/25eb61d7e0fbd4b2a87a81c3fa7dca722f8d8058", 15 | "reference": "25eb61d7e0fbd4b2a87a81c3fa7dca722f8d8058", 16 | "shasum": "" 17 | }, 18 | "require": { 19 | "php": ">=7.4" 20 | }, 21 | "time": "2025-01-07T17:17:53+00:00", 22 | "type": "library", 23 | "extra": { 24 | "wordpress-plugin": true 25 | }, 26 | "installation-source": "dist", 27 | "autoload": { 28 | "psr-4": { 29 | "RobertDevore\\WPComCheck\\": "src/" 30 | } 31 | }, 32 | "notification-url": "https://packagist.org/downloads/", 33 | "license": [ 34 | "MIT" 35 | ], 36 | "authors": [ 37 | { 38 | "name": "Robert DeVore", 39 | "email": "me@robertdevore.com", 40 | "homepage": "https://github.com/robertdevore", 41 | "role": "Developer" 42 | } 43 | ], 44 | "description": "A utility to handle WordPress.com-specific plugin compatibility and auto-deactivation.", 45 | "homepage": "https://github.com/robertdevore/wpcom-check", 46 | "keywords": [ 47 | "compatibility", 48 | "deactivation", 49 | "plugin", 50 | "wordpress", 51 | "wordpress.com" 52 | ], 53 | "support": { 54 | "issues": "https://github.com/robertdevore/wpcom-check/issues", 55 | "source": "https://github.com/robertdevore/wpcom-check/tree/1.0.1" 56 | }, 57 | "install-path": "../robertdevore/wpcom-check" 58 | } 59 | ], 60 | "dev": true, 61 | "dev-package-names": [] 62 | } 63 | -------------------------------------------------------------------------------- /vendor/composer/installed.php: -------------------------------------------------------------------------------- 1 | array( 3 | 'name' => '__root__', 4 | 'pretty_version' => 'dev-main', 5 | 'version' => 'dev-main', 6 | 'reference' => '4c31e1444e81a28732af10fd7d5fb383a23bc6b3', 7 | 'type' => 'library', 8 | 'install_path' => __DIR__ . '/../../', 9 | 'aliases' => array(), 10 | 'dev' => true, 11 | ), 12 | 'versions' => array( 13 | '__root__' => array( 14 | 'pretty_version' => 'dev-main', 15 | 'version' => 'dev-main', 16 | 'reference' => '4c31e1444e81a28732af10fd7d5fb383a23bc6b3', 17 | 'type' => 'library', 18 | 'install_path' => __DIR__ . '/../../', 19 | 'aliases' => array(), 20 | 'dev_requirement' => false, 21 | ), 22 | 'robertdevore/wpcom-check' => array( 23 | 'pretty_version' => '1.0.1', 24 | 'version' => '1.0.1.0', 25 | 'reference' => '25eb61d7e0fbd4b2a87a81c3fa7dca722f8d8058', 26 | 'type' => 'library', 27 | 'install_path' => __DIR__ . '/../robertdevore/wpcom-check', 28 | 'aliases' => array(), 29 | 'dev_requirement' => false, 30 | ), 31 | ), 32 | ); 33 | -------------------------------------------------------------------------------- /vendor/composer/platform_check.php: -------------------------------------------------------------------------------- 1 | = 70400)) { 8 | $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.'; 9 | } 10 | 11 | if ($issues) { 12 | if (!headers_sent()) { 13 | header('HTTP/1.1 500 Internal Server Error'); 14 | } 15 | if (!ini_get('display_errors')) { 16 | if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { 17 | fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); 18 | } elseif (!headers_sent()) { 19 | echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; 20 | } 21 | } 22 | trigger_error( 23 | 'Composer detected issues in your platform: ' . implode(' ', $issues), 24 | E_USER_ERROR 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5/PucFactory.php: -------------------------------------------------------------------------------- 1 | rootDir = dirname(__FILE__) . '/'; 18 | 19 | $namespaceWithSlash = __NAMESPACE__ . '\\'; 20 | $this->prefix = $namespaceWithSlash; 21 | 22 | $this->libraryDir = $this->rootDir . '../..'; 23 | if ( !self::isPhar() ) { 24 | $this->libraryDir = realpath($this->libraryDir); 25 | } 26 | $this->libraryDir = $this->libraryDir . '/'; 27 | 28 | //Usually, dependencies like Parsedown are in the global namespace, 29 | //but if someone adds a custom namespace to the entire library, they 30 | //will be in the same namespace as this class. 31 | $isCustomNamespace = ( 32 | substr($namespaceWithSlash, 0, strlen(self::DEFAULT_NS_PREFIX)) !== self::DEFAULT_NS_PREFIX 33 | ); 34 | $libraryPrefix = $isCustomNamespace ? $namespaceWithSlash : ''; 35 | 36 | $this->staticMap = array( 37 | $libraryPrefix . 'PucReadmeParser' => 'vendor/PucReadmeParser.php', 38 | $libraryPrefix . 'Parsedown' => 'vendor/Parsedown.php', 39 | ); 40 | 41 | //Add the generic, major-version-only factory class to the static map. 42 | $versionSeparatorPos = strrpos(__NAMESPACE__, '\\v'); 43 | if ( $versionSeparatorPos !== false ) { 44 | $versionSegment = substr(__NAMESPACE__, $versionSeparatorPos + 1); 45 | $pointPos = strpos($versionSegment, 'p'); 46 | if ( ($pointPos !== false) && ($pointPos > 1) ) { 47 | $majorVersionSegment = substr($versionSegment, 0, $pointPos); 48 | $majorVersionNs = __NAMESPACE__ . '\\' . $majorVersionSegment; 49 | $this->staticMap[$majorVersionNs . '\\PucFactory'] = 50 | 'Puc/' . $majorVersionSegment . '/Factory.php'; 51 | } 52 | } 53 | 54 | spl_autoload_register(array($this, 'autoload')); 55 | } 56 | 57 | /** 58 | * Determine if this file is running as part of a Phar archive. 59 | * 60 | * @return bool 61 | */ 62 | private static function isPhar() { 63 | //Check if the current file path starts with "phar://". 64 | static $pharProtocol = 'phar://'; 65 | return (substr(__FILE__, 0, strlen($pharProtocol)) === $pharProtocol); 66 | } 67 | 68 | public function autoload($className) { 69 | if ( isset($this->staticMap[$className]) && file_exists($this->libraryDir . $this->staticMap[$className]) ) { 70 | include($this->libraryDir . $this->staticMap[$className]); 71 | return; 72 | } 73 | 74 | if ( strpos($className, $this->prefix) === 0 ) { 75 | $path = substr($className, strlen($this->prefix)); 76 | $path = str_replace(array('_', '\\'), '/', $path); 77 | $path = $this->rootDir . $path . '.php'; 78 | 79 | if ( file_exists($path) ) { 80 | include $path; 81 | } 82 | } 83 | } 84 | } 85 | 86 | endif; 87 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/DebugBar/Extension.php: -------------------------------------------------------------------------------- 1 | updateChecker = $updateChecker; 18 | if ( isset($panelClass) ) { 19 | $this->panelClass = $panelClass; 20 | } 21 | 22 | if ( (strpos($this->panelClass, '\\') === false) ) { 23 | $this->panelClass = __NAMESPACE__ . '\\' . $this->panelClass; 24 | } 25 | 26 | add_filter('debug_bar_panels', array($this, 'addDebugBarPanel')); 27 | add_action('debug_bar_enqueue_scripts', array($this, 'enqueuePanelDependencies')); 28 | 29 | add_action('wp_ajax_puc_v5_debug_check_now', array($this, 'ajaxCheckNow')); 30 | } 31 | 32 | /** 33 | * Register the PUC Debug Bar panel. 34 | * 35 | * @param array $panels 36 | * @return array 37 | */ 38 | public function addDebugBarPanel($panels) { 39 | if ( $this->updateChecker->userCanInstallUpdates() ) { 40 | $panels[] = new $this->panelClass($this->updateChecker); 41 | } 42 | return $panels; 43 | } 44 | 45 | /** 46 | * Enqueue our Debug Bar scripts and styles. 47 | */ 48 | public function enqueuePanelDependencies() { 49 | wp_enqueue_style( 50 | 'puc-debug-bar-style-v5', 51 | $this->getLibraryUrl("/css/puc-debug-bar.css"), 52 | array('debug-bar'), 53 | '20221008' 54 | ); 55 | 56 | wp_enqueue_script( 57 | 'puc-debug-bar-js-v5', 58 | $this->getLibraryUrl("/js/debug-bar.js"), 59 | array('jquery'), 60 | '20221008' 61 | ); 62 | } 63 | 64 | /** 65 | * Run an update check and output the result. Useful for making sure that 66 | * the update checking process works as expected. 67 | */ 68 | public function ajaxCheckNow() { 69 | //phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce is checked in preAjaxRequest(). 70 | if ( !isset($_POST['uid']) || ($_POST['uid'] !== $this->updateChecker->getUniqueName('uid')) ) { 71 | return; 72 | } 73 | $this->preAjaxRequest(); 74 | $update = $this->updateChecker->checkForUpdates(); 75 | if ( $update !== null ) { 76 | echo "An update is available:"; 77 | //phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_print_r -- For debugging output. 78 | echo '
', esc_html(print_r($update, true)), ''; 79 | } else { 80 | echo 'No updates found.'; 81 | } 82 | 83 | $errors = $this->updateChecker->getLastRequestApiErrors(); 84 | if ( !empty($errors) ) { 85 | printf('
The update checker encountered %d API error%s.
', count($errors), (count($errors) > 1) ? 's' : ''); 86 | 87 | foreach (array_values($errors) as $num => $item) { 88 | $wpError = $item['error']; 89 | /** @var \WP_Error $wpError */ 90 | printf('%s
%s
%s
)%d %s
'; 118 | foreach (wp_remote_retrieve_headers($item['httpResponse']) as $name => $value) { 119 | printf("%s: %s\n", esc_html($name), esc_html($value)); 120 | } 121 | echo '
%s
' . htmlentities(print_r($value, true)) . ''; 166 | } else if ($value === null) { 167 | $value = '
null
';
168 | }
169 | printf(
170 | '', esc_html(print_r($info, true)), ''; 33 | } else { 34 | echo 'Failed to retrieve plugin info from the metadata URL.'; 35 | } 36 | exit; 37 | } 38 | } 39 | 40 | endif; 41 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/DebugBar/PluginPanel.php: -------------------------------------------------------------------------------- 1 | row('Plugin file', htmlentities($this->updateChecker->pluginFile)); 16 | parent::displayConfigHeader(); 17 | } 18 | 19 | protected function getMetadataButton() { 20 | $requestInfoButton = ''; 21 | if ( function_exists('get_submit_button') ) { 22 | $requestInfoButton = get_submit_button( 23 | 'Request Info', 24 | 'secondary', 25 | 'puc-request-info-button', 26 | false, 27 | array('id' => $this->updateChecker->getUniqueName('request-info-button')) 28 | ); 29 | } 30 | return $requestInfoButton; 31 | } 32 | 33 | protected function getUpdateFields() { 34 | return array_merge( 35 | parent::getUpdateFields(), 36 | array('homepage', 'upgrade_notice', 'tested',) 37 | ); 38 | } 39 | } 40 | 41 | endif; 42 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/DebugBar/ThemePanel.php: -------------------------------------------------------------------------------- 1 | row('Theme directory', htmlentities($this->updateChecker->directoryName)); 17 | parent::displayConfigHeader(); 18 | } 19 | 20 | protected function getUpdateFields() { 21 | return array_merge(parent::getUpdateFields(), array('details_url')); 22 | } 23 | } 24 | 25 | endif; 26 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/InstalledPackage.php: -------------------------------------------------------------------------------- 1 | updateChecker = $updateChecker; 20 | } 21 | 22 | /** 23 | * Get the currently installed version of the plugin or theme. 24 | * 25 | * @return string|null Version number. 26 | */ 27 | abstract public function getInstalledVersion(); 28 | 29 | /** 30 | * Get the full path of the plugin or theme directory (without a trailing slash). 31 | * 32 | * @return string 33 | */ 34 | abstract public function getAbsoluteDirectoryPath(); 35 | 36 | /** 37 | * Check whether a regular file exists in the package's directory. 38 | * 39 | * @param string $relativeFileName File name relative to the package directory. 40 | * @return bool 41 | */ 42 | public function fileExists($relativeFileName) { 43 | return is_file( 44 | $this->getAbsoluteDirectoryPath() 45 | . DIRECTORY_SEPARATOR 46 | . ltrim($relativeFileName, '/\\') 47 | ); 48 | } 49 | 50 | /* ------------------------------------------------------------------- 51 | * File header parsing 52 | * ------------------------------------------------------------------- 53 | */ 54 | 55 | /** 56 | * Parse plugin or theme metadata from the header comment. 57 | * 58 | * This is basically a simplified version of the get_file_data() function from /wp-includes/functions.php. 59 | * It's intended as a utility for subclasses that detect updates by parsing files in a VCS. 60 | * 61 | * @param string|null $content File contents. 62 | * @return string[] 63 | */ 64 | public function getFileHeader($content) { 65 | $content = (string)$content; 66 | 67 | //WordPress only looks at the first 8 KiB of the file, so we do the same. 68 | $content = substr($content, 0, 8192); 69 | //Normalize line endings. 70 | $content = str_replace("\r", "\n", $content); 71 | 72 | $headers = $this->getHeaderNames(); 73 | $results = array(); 74 | foreach ($headers as $field => $name) { 75 | $success = preg_match('/^[ \t\/*#@]*' . preg_quote($name, '/') . ':(.*)$/mi', $content, $matches); 76 | 77 | if ( ($success === 1) && $matches[1] ) { 78 | $value = $matches[1]; 79 | if ( function_exists('_cleanup_header_comment') ) { 80 | $value = _cleanup_header_comment($value); 81 | } 82 | $results[$field] = $value; 83 | } else { 84 | $results[$field] = ''; 85 | } 86 | } 87 | 88 | return $results; 89 | } 90 | 91 | /** 92 | * @return array Format: ['HeaderKey' => 'Header Name'] 93 | */ 94 | abstract protected function getHeaderNames(); 95 | 96 | /** 97 | * Get the value of a specific plugin or theme header. 98 | * 99 | * @param string $headerName 100 | * @return string Either the value of the header, or an empty string if the header doesn't exist. 101 | */ 102 | abstract public function getHeaderValue($headerName); 103 | 104 | } 105 | endif; 106 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/Metadata.php: -------------------------------------------------------------------------------- 1 | 22 | */ 23 | protected $extraProperties = array(); 24 | 25 | /** 26 | * Create an instance of this class from a JSON document. 27 | * 28 | * @abstract 29 | * @param string $json 30 | * @return self 31 | */ 32 | public static function fromJson($json) { 33 | throw new LogicException('The ' . __METHOD__ . ' method must be implemented by subclasses'); 34 | } 35 | 36 | /** 37 | * @param string $json 38 | * @param self $target 39 | * @return bool 40 | */ 41 | protected static function createFromJson($json, $target) { 42 | /** @var \StdClass $apiResponse */ 43 | $apiResponse = json_decode($json); 44 | if ( empty($apiResponse) || !is_object($apiResponse) ){ 45 | $errorMessage = "Failed to parse update metadata. Try validating your .json file with https://jsonlint.com/"; 46 | do_action('puc_api_error', new WP_Error('puc-invalid-json', $errorMessage)); 47 | //phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error -- For plugin developers. 48 | trigger_error(esc_html($errorMessage), E_USER_NOTICE); 49 | return false; 50 | } 51 | 52 | $valid = $target->validateMetadata($apiResponse); 53 | if ( is_wp_error($valid) ){ 54 | do_action('puc_api_error', $valid); 55 | //phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error -- For plugin developers. 56 | trigger_error(esc_html($valid->get_error_message()), E_USER_NOTICE); 57 | return false; 58 | } 59 | 60 | foreach(get_object_vars($apiResponse) as $key => $value){ 61 | $target->$key = $value; 62 | } 63 | 64 | return true; 65 | } 66 | 67 | /** 68 | * No validation by default! Subclasses should check that the required fields are present. 69 | * 70 | * @param \StdClass $apiResponse 71 | * @return bool|\WP_Error 72 | */ 73 | protected function validateMetadata($apiResponse) { 74 | return true; 75 | } 76 | 77 | /** 78 | * Create a new instance by copying the necessary fields from another object. 79 | * 80 | * @abstract 81 | * @param \StdClass|self $object The source object. 82 | * @return self The new copy. 83 | */ 84 | public static function fromObject($object) { 85 | throw new LogicException('The ' . __METHOD__ . ' method must be implemented by subclasses'); 86 | } 87 | 88 | /** 89 | * Create an instance of StdClass that can later be converted back to an 90 | * update or info container. Useful for serialization and caching, as it 91 | * avoids the "incomplete object" problem if the cached value is loaded 92 | * before this class. 93 | * 94 | * @return \StdClass 95 | */ 96 | public function toStdClass() { 97 | $object = new stdClass(); 98 | $this->copyFields($this, $object); 99 | return $object; 100 | } 101 | 102 | /** 103 | * Transform the metadata into the format used by WordPress core. 104 | * 105 | * @return object 106 | */ 107 | abstract public function toWpFormat(); 108 | 109 | /** 110 | * Copy known fields from one object to another. 111 | * 112 | * @param \StdClass|self $from 113 | * @param \StdClass|self $to 114 | */ 115 | protected function copyFields($from, $to) { 116 | $fields = $this->getFieldNames(); 117 | 118 | if ( property_exists($from, 'slug') && !empty($from->slug) ) { 119 | //Let plugins add extra fields without having to create subclasses. 120 | $fields = apply_filters($this->getPrefixedFilter('retain_fields') . '-' . $from->slug, $fields); 121 | } 122 | 123 | foreach ($fields as $field) { 124 | if ( property_exists($from, $field) ) { 125 | $to->$field = $from->$field; 126 | } 127 | } 128 | } 129 | 130 | /** 131 | * @return string[] 132 | */ 133 | protected function getFieldNames() { 134 | return array(); 135 | } 136 | 137 | /** 138 | * @param string $tag 139 | * @return string 140 | */ 141 | protected function getPrefixedFilter($tag) { 142 | return 'puc_' . $tag; 143 | } 144 | 145 | public function __set($name, $value) { 146 | $this->extraProperties[$name] = $value; 147 | } 148 | 149 | public function __get($name) { 150 | return isset($this->extraProperties[$name]) ? $this->extraProperties[$name] : null; 151 | } 152 | 153 | public function __isset($name) { 154 | return isset($this->extraProperties[$name]); 155 | } 156 | 157 | public function __unset($name) { 158 | unset($this->extraProperties[$name]); 159 | } 160 | } 161 | 162 | endif; 163 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/OAuthSignature.php: -------------------------------------------------------------------------------- 1 | consumerKey = $consumerKey; 15 | $this->consumerSecret = $consumerSecret; 16 | } 17 | 18 | /** 19 | * Sign a URL using OAuth 1.0. 20 | * 21 | * @param string $url The URL to be signed. It may contain query parameters. 22 | * @param string $method HTTP method such as "GET", "POST" and so on. 23 | * @return string The signed URL. 24 | */ 25 | public function sign($url, $method = 'GET') { 26 | $parameters = array(); 27 | 28 | //Parse query parameters. 29 | $query = wp_parse_url($url, PHP_URL_QUERY); 30 | if ( !empty($query) ) { 31 | parse_str($query, $parsedParams); 32 | if ( is_array($parsedParams) ) { 33 | $parameters = $parsedParams; 34 | } 35 | //Remove the query string from the URL. We'll replace it later. 36 | $url = substr($url, 0, strpos($url, '?')); 37 | } 38 | 39 | $parameters = array_merge( 40 | $parameters, 41 | array( 42 | 'oauth_consumer_key' => $this->consumerKey, 43 | 'oauth_nonce' => $this->nonce(), 44 | 'oauth_signature_method' => 'HMAC-SHA1', 45 | 'oauth_timestamp' => time(), 46 | 'oauth_version' => '1.0', 47 | ) 48 | ); 49 | unset($parameters['oauth_signature']); 50 | 51 | //Parameters must be sorted alphabetically before signing. 52 | ksort($parameters); 53 | 54 | //The most complicated part of the request - generating the signature. 55 | //The string to sign contains the HTTP method, the URL path, and all of 56 | //our query parameters. Everything is URL encoded. Then we concatenate 57 | //them with ampersands into a single string to hash. 58 | $encodedVerb = urlencode($method); 59 | $encodedUrl = urlencode($url); 60 | $encodedParams = urlencode(http_build_query($parameters, '', '&')); 61 | 62 | $stringToSign = $encodedVerb . '&' . $encodedUrl . '&' . $encodedParams; 63 | 64 | //Since we only have one OAuth token (the consumer secret) we only have 65 | //to use it as our HMAC key. However, we still have to append an & to it 66 | //as if we were using it with additional tokens. 67 | $secret = urlencode($this->consumerSecret) . '&'; 68 | 69 | //The signature is a hash of the consumer key and the base string. Note 70 | //that we have to get the raw output from hash_hmac and base64 encode 71 | //the binary data result. 72 | $parameters['oauth_signature'] = base64_encode(hash_hmac('sha1', $stringToSign, $secret, true)); 73 | 74 | return ($url . '?' . http_build_query($parameters)); 75 | } 76 | 77 | /** 78 | * Generate a random nonce. 79 | * 80 | * @return string 81 | */ 82 | private function nonce() { 83 | $mt = microtime(); 84 | 85 | $rand = null; 86 | if ( is_callable('random_bytes') ) { 87 | try { 88 | $rand = random_bytes(16); 89 | } catch (\Exception $ex) { 90 | //Fall back to mt_rand (below). 91 | } 92 | } 93 | if ( $rand === null ) { 94 | //phpcs:ignore WordPress.WP.AlternativeFunctions.rand_mt_rand 95 | $rand = function_exists('wp_rand') ? wp_rand() : mt_rand(); 96 | } 97 | 98 | return md5($mt . '_' . $rand); 99 | } 100 | } 101 | 102 | endif; 103 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/Plugin/Package.php: -------------------------------------------------------------------------------- 1 | pluginAbsolutePath = $pluginAbsolutePath; 32 | $this->pluginFile = plugin_basename($this->pluginAbsolutePath); 33 | 34 | parent::__construct($updateChecker); 35 | 36 | //Clear the version number cache when something - anything - is upgraded or WP clears the update cache. 37 | add_filter('upgrader_post_install', array($this, 'clearCachedVersion')); 38 | add_action('delete_site_transient_update_plugins', array($this, 'clearCachedVersion')); 39 | } 40 | 41 | public function getInstalledVersion() { 42 | if ( isset($this->cachedInstalledVersion) ) { 43 | return $this->cachedInstalledVersion; 44 | } 45 | 46 | $pluginHeader = $this->getPluginHeader(); 47 | if ( isset($pluginHeader['Version']) ) { 48 | $this->cachedInstalledVersion = $pluginHeader['Version']; 49 | return $pluginHeader['Version']; 50 | } else { 51 | //This can happen if the filename points to something that is not a plugin. 52 | $this->updateChecker->triggerError( 53 | sprintf( 54 | "Cannot read the Version header for '%s'. The filename is incorrect or is not a plugin.", 55 | $this->updateChecker->pluginFile 56 | ), 57 | E_USER_WARNING 58 | ); 59 | return null; 60 | } 61 | } 62 | 63 | /** 64 | * Clear the cached plugin version. This method can be set up as a filter (hook) and will 65 | * return the filter argument unmodified. 66 | * 67 | * @param mixed $filterArgument 68 | * @return mixed 69 | */ 70 | public function clearCachedVersion($filterArgument = null) { 71 | $this->cachedInstalledVersion = null; 72 | return $filterArgument; 73 | } 74 | 75 | public function getAbsoluteDirectoryPath() { 76 | return dirname($this->pluginAbsolutePath); 77 | } 78 | 79 | /** 80 | * Get the value of a specific plugin or theme header. 81 | * 82 | * @param string $headerName 83 | * @param string $defaultValue 84 | * @return string Either the value of the header, or $defaultValue if the header doesn't exist or is empty. 85 | */ 86 | public function getHeaderValue($headerName, $defaultValue = '') { 87 | $headers = $this->getPluginHeader(); 88 | if ( isset($headers[$headerName]) && ($headers[$headerName] !== '') ) { 89 | return $headers[$headerName]; 90 | } 91 | return $defaultValue; 92 | } 93 | 94 | protected function getHeaderNames() { 95 | return array( 96 | 'Name' => 'Plugin Name', 97 | 'PluginURI' => 'Plugin URI', 98 | 'Version' => 'Version', 99 | 'Description' => 'Description', 100 | 'Author' => 'Author', 101 | 'AuthorURI' => 'Author URI', 102 | 'TextDomain' => 'Text Domain', 103 | 'DomainPath' => 'Domain Path', 104 | 'Network' => 'Network', 105 | 106 | //The newest WordPress version that this plugin requires or has been tested with. 107 | //We support several different formats for compatibility with other libraries. 108 | 'Tested WP' => 'Tested WP', 109 | 'Requires WP' => 'Requires WP', 110 | 'Tested up to' => 'Tested up to', 111 | 'Requires at least' => 'Requires at least', 112 | ); 113 | } 114 | 115 | /** 116 | * Get the translated plugin title. 117 | * 118 | * @return string 119 | */ 120 | public function getPluginTitle() { 121 | $title = ''; 122 | $header = $this->getPluginHeader(); 123 | if ( $header && !empty($header['Name']) && isset($header['TextDomain']) ) { 124 | $title = translate($header['Name'], $header['TextDomain']); 125 | } 126 | return $title; 127 | } 128 | 129 | /** 130 | * Get plugin's metadata from its file header. 131 | * 132 | * @return array 133 | */ 134 | public function getPluginHeader() { 135 | if ( !is_file($this->pluginAbsolutePath) ) { 136 | //This can happen if the plugin filename is wrong. 137 | $this->updateChecker->triggerError( 138 | sprintf( 139 | "Can't to read the plugin header for '%s'. The file does not exist.", 140 | $this->updateChecker->pluginFile 141 | ), 142 | E_USER_WARNING 143 | ); 144 | return array(); 145 | } 146 | 147 | if ( !function_exists('get_plugin_data') ) { 148 | require_once(ABSPATH . '/wp-admin/includes/plugin.php'); 149 | } 150 | return get_plugin_data($this->pluginAbsolutePath, false, false); 151 | } 152 | 153 | public function removeHooks() { 154 | remove_filter('upgrader_post_install', array($this, 'clearCachedVersion')); 155 | remove_action('delete_site_transient_update_plugins', array($this, 'clearCachedVersion')); 156 | } 157 | 158 | /** 159 | * Check if the plugin file is inside the mu-plugins directory. 160 | * 161 | * @return bool 162 | */ 163 | public function isMuPlugin() { 164 | static $cachedResult = null; 165 | 166 | if ( $cachedResult === null ) { 167 | if ( !defined('WPMU_PLUGIN_DIR') || !is_string(WPMU_PLUGIN_DIR) ) { 168 | $cachedResult = false; 169 | return $cachedResult; 170 | } 171 | 172 | //Convert both paths to the canonical form before comparison. 173 | $muPluginDir = realpath(WPMU_PLUGIN_DIR); 174 | $pluginPath = realpath($this->pluginAbsolutePath); 175 | //If realpath() fails, just normalize the syntax instead. 176 | if (($muPluginDir === false) || ($pluginPath === false)) { 177 | $muPluginDir = PucFactory::normalizePath(WPMU_PLUGIN_DIR); 178 | $pluginPath = PucFactory::normalizePath($this->pluginAbsolutePath); 179 | } 180 | 181 | $cachedResult = (strpos($pluginPath, $muPluginDir) === 0); 182 | } 183 | 184 | return $cachedResult; 185 | } 186 | } 187 | 188 | endif; 189 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/Plugin/PluginInfo.php: -------------------------------------------------------------------------------- 1 | sections = (array)$instance->sections; 63 | $instance->icons = (array)$instance->icons; 64 | 65 | return $instance; 66 | } 67 | 68 | /** 69 | * Very, very basic validation. 70 | * 71 | * @param \StdClass $apiResponse 72 | * @return bool|\WP_Error 73 | */ 74 | protected function validateMetadata($apiResponse) { 75 | if ( 76 | !isset($apiResponse->name, $apiResponse->version) 77 | || empty($apiResponse->name) 78 | || empty($apiResponse->version) 79 | ) { 80 | return new \WP_Error( 81 | 'puc-invalid-metadata', 82 | "The plugin metadata file does not contain the required 'name' and/or 'version' keys." 83 | ); 84 | } 85 | return true; 86 | } 87 | 88 | 89 | /** 90 | * Transform plugin info into the format used by the native WordPress.org API 91 | * 92 | * @return object 93 | */ 94 | public function toWpFormat(){ 95 | $info = new \stdClass; 96 | 97 | //The custom update API is built so that many fields have the same name and format 98 | //as those returned by the native WordPress.org API. These can be assigned directly. 99 | $sameFormat = array( 100 | 'name', 'slug', 'version', 'requires', 'tested', 'rating', 'upgrade_notice', 101 | 'num_ratings', 'downloaded', 'active_installs', 'homepage', 'last_updated', 102 | 'requires_php', 103 | ); 104 | foreach($sameFormat as $field){ 105 | if ( isset($this->$field) ) { 106 | $info->$field = $this->$field; 107 | } else { 108 | $info->$field = null; 109 | } 110 | } 111 | 112 | //Other fields need to be renamed and/or transformed. 113 | $info->download_link = $this->download_url; 114 | $info->author = $this->getFormattedAuthor(); 115 | $info->sections = array_merge(array('description' => ''), $this->sections); 116 | 117 | if ( !empty($this->banners) ) { 118 | //WP expects an array with two keys: "high" and "low". Both are optional. 119 | //Docs: https://wordpress.org/plugins/about/faq/#banners 120 | $info->banners = is_object($this->banners) ? get_object_vars($this->banners) : $this->banners; 121 | $info->banners = array_intersect_key($info->banners, array('high' => true, 'low' => true)); 122 | } 123 | 124 | return $info; 125 | } 126 | 127 | protected function getFormattedAuthor() { 128 | if ( !empty($this->author_homepage) ){ 129 | /** @noinspection HtmlUnknownTarget */ 130 | return sprintf('%s', $this->author_homepage, $this->author); 131 | } 132 | return $this->author; 133 | } 134 | } 135 | 136 | endif; 137 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/Plugin/Update.php: -------------------------------------------------------------------------------- 1 | copyFields($object, $update); 66 | return $update; 67 | } 68 | 69 | /** 70 | * @return string[] 71 | */ 72 | protected function getFieldNames() { 73 | return array_merge(parent::getFieldNames(), self::$extraFields); 74 | } 75 | 76 | /** 77 | * Transform the update into the format used by WordPress native plugin API. 78 | * 79 | * @return object 80 | */ 81 | public function toWpFormat() { 82 | $update = parent::toWpFormat(); 83 | 84 | $update->id = $this->id; 85 | $update->url = $this->homepage; 86 | $update->tested = $this->tested; 87 | $update->requires_php = $this->requires_php; 88 | $update->plugin = $this->filename; 89 | 90 | if ( !empty($this->upgrade_notice) ) { 91 | $update->upgrade_notice = $this->upgrade_notice; 92 | } 93 | 94 | if ( !empty($this->icons) && is_array($this->icons) ) { 95 | //This should be an array with up to 4 keys: 'svg', '1x', '2x' and 'default'. 96 | //Docs: https://developer.wordpress.org/plugins/wordpress-org/plugin-assets/#plugin-icons 97 | $icons = array_intersect_key( 98 | $this->icons, 99 | array('svg' => true, '1x' => true, '2x' => true, 'default' => true) 100 | ); 101 | if ( !empty($icons) ) { 102 | $update->icons = $icons; 103 | 104 | //It appears that the 'default' icon isn't used anywhere in WordPress 4.9, 105 | //but lets set it just in case a future release needs it. 106 | if ( !isset($update->icons['default']) ) { 107 | $update->icons['default'] = current($update->icons); 108 | } 109 | } 110 | } 111 | 112 | return $update; 113 | } 114 | } 115 | 116 | endif; 117 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/StateStore.php: -------------------------------------------------------------------------------- 1 | optionName = $optionName; 34 | } 35 | 36 | /** 37 | * Get time elapsed since the last update check. 38 | * 39 | * If there are no recorded update checks, this method returns a large arbitrary number 40 | * (i.e. time since the Unix epoch). 41 | * 42 | * @return int Elapsed time in seconds. 43 | */ 44 | public function timeSinceLastCheck() { 45 | $this->lazyLoad(); 46 | return time() - $this->lastCheck; 47 | } 48 | 49 | /** 50 | * @return int 51 | */ 52 | public function getLastCheck() { 53 | $this->lazyLoad(); 54 | return $this->lastCheck; 55 | } 56 | 57 | /** 58 | * Set the time of the last update check to the current timestamp. 59 | * 60 | * @return $this 61 | */ 62 | public function setLastCheckToNow() { 63 | $this->lazyLoad(); 64 | $this->lastCheck = time(); 65 | return $this; 66 | } 67 | 68 | /** 69 | * @return null|Update 70 | */ 71 | public function getUpdate() { 72 | $this->lazyLoad(); 73 | return $this->update; 74 | } 75 | 76 | /** 77 | * @param Update|null $update 78 | * @return $this 79 | */ 80 | public function setUpdate(Update $update = null) { 81 | $this->lazyLoad(); 82 | $this->update = $update; 83 | return $this; 84 | } 85 | 86 | /** 87 | * @return string 88 | */ 89 | public function getCheckedVersion() { 90 | $this->lazyLoad(); 91 | return $this->checkedVersion; 92 | } 93 | 94 | /** 95 | * @param string $version 96 | * @return $this 97 | */ 98 | public function setCheckedVersion($version) { 99 | $this->lazyLoad(); 100 | $this->checkedVersion = strval($version); 101 | return $this; 102 | } 103 | 104 | /** 105 | * Get translation updates. 106 | * 107 | * @return array 108 | */ 109 | public function getTranslations() { 110 | $this->lazyLoad(); 111 | if ( isset($this->update, $this->update->translations) ) { 112 | return $this->update->translations; 113 | } 114 | return array(); 115 | } 116 | 117 | /** 118 | * Set translation updates. 119 | * 120 | * @param array $translationUpdates 121 | */ 122 | public function setTranslations($translationUpdates) { 123 | $this->lazyLoad(); 124 | if ( isset($this->update) ) { 125 | $this->update->translations = $translationUpdates; 126 | $this->save(); 127 | } 128 | } 129 | 130 | public function save() { 131 | $state = new \stdClass(); 132 | 133 | $state->lastCheck = $this->lastCheck; 134 | $state->checkedVersion = $this->checkedVersion; 135 | 136 | if ( isset($this->update)) { 137 | $state->update = $this->update->toStdClass(); 138 | 139 | $updateClass = get_class($this->update); 140 | $state->updateClass = $updateClass; 141 | $prefix = $this->getLibPrefix(); 142 | if ( Utils::startsWith($updateClass, $prefix) ) { 143 | $state->updateBaseClass = substr($updateClass, strlen($prefix)); 144 | } 145 | } 146 | 147 | update_site_option($this->optionName, $state); 148 | $this->isLoaded = true; 149 | } 150 | 151 | /** 152 | * @return $this 153 | */ 154 | public function lazyLoad() { 155 | if ( !$this->isLoaded ) { 156 | $this->load(); 157 | } 158 | return $this; 159 | } 160 | 161 | protected function load() { 162 | $this->isLoaded = true; 163 | 164 | $state = get_site_option($this->optionName, null); 165 | 166 | if ( 167 | !is_object($state) 168 | //Sanity check: If the Utils class is missing, the plugin is probably in the process 169 | //of being deleted (e.g. the old version gets deleted during an update). 170 | || !class_exists(Utils::class) 171 | ) { 172 | $this->lastCheck = 0; 173 | $this->checkedVersion = ''; 174 | $this->update = null; 175 | return; 176 | } 177 | 178 | $this->lastCheck = intval(Utils::get($state, 'lastCheck', 0)); 179 | $this->checkedVersion = Utils::get($state, 'checkedVersion', ''); 180 | $this->update = null; 181 | 182 | if ( isset($state->update) ) { 183 | //This mess is due to the fact that the want the update class from this version 184 | //of the library, not the version that saved the update. 185 | 186 | $updateClass = null; 187 | if ( isset($state->updateBaseClass) ) { 188 | $updateClass = $this->getLibPrefix() . $state->updateBaseClass; 189 | } else if ( isset($state->updateClass) ) { 190 | $updateClass = $state->updateClass; 191 | } 192 | 193 | $factory = array($updateClass, 'fromObject'); 194 | if ( ($updateClass !== null) && is_callable($factory) ) { 195 | $this->update = call_user_func($factory, $state->update); 196 | } 197 | } 198 | } 199 | 200 | public function delete() { 201 | delete_site_option($this->optionName); 202 | 203 | $this->lastCheck = 0; 204 | $this->checkedVersion = ''; 205 | $this->update = null; 206 | } 207 | 208 | private function getLibPrefix() { 209 | //This assumes that the current class is at the top of the versioned namespace. 210 | return __NAMESPACE__ . '\\'; 211 | } 212 | } 213 | 214 | endif; 215 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/Theme/Package.php: -------------------------------------------------------------------------------- 1 | stylesheet = $stylesheet; 21 | $this->theme = wp_get_theme($this->stylesheet); 22 | 23 | parent::__construct($updateChecker); 24 | } 25 | 26 | public function getInstalledVersion() { 27 | return $this->theme->get('Version'); 28 | } 29 | 30 | public function getAbsoluteDirectoryPath() { 31 | if ( method_exists($this->theme, 'get_stylesheet_directory') ) { 32 | return $this->theme->get_stylesheet_directory(); //Available since WP 3.4. 33 | } 34 | return get_theme_root($this->stylesheet) . '/' . $this->stylesheet; 35 | } 36 | 37 | /** 38 | * Get the value of a specific plugin or theme header. 39 | * 40 | * @param string $headerName 41 | * @param string $defaultValue 42 | * @return string Either the value of the header, or $defaultValue if the header doesn't exist or is empty. 43 | */ 44 | public function getHeaderValue($headerName, $defaultValue = '') { 45 | $value = $this->theme->get($headerName); 46 | if ( ($headerName === false) || ($headerName === '') ) { 47 | return $defaultValue; 48 | } 49 | return $value; 50 | } 51 | 52 | protected function getHeaderNames() { 53 | return array( 54 | 'Name' => 'Theme Name', 55 | 'ThemeURI' => 'Theme URI', 56 | 'Description' => 'Description', 57 | 'Author' => 'Author', 58 | 'AuthorURI' => 'Author URI', 59 | 'Version' => 'Version', 60 | 'Template' => 'Template', 61 | 'Status' => 'Status', 62 | 'Tags' => 'Tags', 63 | 'TextDomain' => 'Text Domain', 64 | 'DomainPath' => 'Domain Path', 65 | ); 66 | } 67 | } 68 | 69 | endif; 70 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/Theme/Update.php: -------------------------------------------------------------------------------- 1 | $this->slug, 23 | 'new_version' => $this->version, 24 | 'url' => $this->details_url, 25 | ); 26 | 27 | if ( !empty($this->download_url) ) { 28 | $update['package'] = $this->download_url; 29 | } 30 | 31 | return $update; 32 | } 33 | 34 | /** 35 | * Create a new instance of Theme_Update from its JSON-encoded representation. 36 | * 37 | * @param string $json Valid JSON string representing a theme information object. 38 | * @return self New instance of ThemeUpdate, or NULL on error. 39 | */ 40 | public static function fromJson($json) { 41 | $instance = new self(); 42 | if ( !parent::createFromJson($json, $instance) ) { 43 | return null; 44 | } 45 | return $instance; 46 | } 47 | 48 | /** 49 | * Create a new instance by copying the necessary fields from another object. 50 | * 51 | * @param \StdClass|self $object The source object. 52 | * @return self The new copy. 53 | */ 54 | public static function fromObject($object) { 55 | $update = new self(); 56 | $update->copyFields($object, $update); 57 | return $update; 58 | } 59 | 60 | /** 61 | * Basic validation. 62 | * 63 | * @param \StdClass $apiResponse 64 | * @return bool|\WP_Error 65 | */ 66 | protected function validateMetadata($apiResponse) { 67 | $required = array('version', 'details_url'); 68 | foreach($required as $key) { 69 | if ( !isset($apiResponse->$key) || empty($apiResponse->$key) ) { 70 | return new \WP_Error( 71 | 'tuc-invalid-metadata', 72 | sprintf('The theme metadata is missing the required "%s" key.', $key) 73 | ); 74 | } 75 | } 76 | return true; 77 | } 78 | 79 | protected function getFieldNames() { 80 | return array_merge(parent::getFieldNames(), self::$extraFields); 81 | } 82 | 83 | protected function getPrefixedFilter($tag) { 84 | return parent::getPrefixedFilter($tag) . '_theme'; 85 | } 86 | } 87 | 88 | endif; 89 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/Theme/UpdateChecker.php: -------------------------------------------------------------------------------- 1 | stylesheet = $stylesheet; 27 | 28 | parent::__construct( 29 | $metadataUrl, 30 | $stylesheet, 31 | $customSlug ? $customSlug : $stylesheet, 32 | $checkPeriod, 33 | $optionName 34 | ); 35 | } 36 | 37 | /** 38 | * For themes, the update array is indexed by theme directory name. 39 | * 40 | * @return string 41 | */ 42 | protected function getUpdateListKey() { 43 | return $this->directoryName; 44 | } 45 | 46 | /** 47 | * Retrieve the latest update (if any) from the configured API endpoint. 48 | * 49 | * @return Update|null An instance of Update, or NULL when no updates are available. 50 | */ 51 | public function requestUpdate() { 52 | list($themeUpdate, $result) = $this->requestMetadata(Update::class, 'request_update'); 53 | 54 | if ( $themeUpdate !== null ) { 55 | /** @var Update $themeUpdate */ 56 | $themeUpdate->slug = $this->slug; 57 | } 58 | 59 | $themeUpdate = $this->filterUpdateResult($themeUpdate, $result); 60 | return $themeUpdate; 61 | } 62 | 63 | protected function getNoUpdateItemFields() { 64 | return array_merge( 65 | parent::getNoUpdateItemFields(), 66 | array( 67 | 'theme' => $this->directoryName, 68 | 'requires' => '', 69 | ) 70 | ); 71 | } 72 | 73 | public function userCanInstallUpdates() { 74 | return current_user_can('update_themes'); 75 | } 76 | 77 | /** 78 | * Create an instance of the scheduler. 79 | * 80 | * @param int $checkPeriod 81 | * @return Scheduler 82 | */ 83 | protected function createScheduler($checkPeriod) { 84 | return new Scheduler($this, $checkPeriod, array('load-themes.php')); 85 | } 86 | 87 | /** 88 | * Is there an update being installed right now for this theme? 89 | * 90 | * @param \WP_Upgrader|null $upgrader The upgrader that's performing the current update. 91 | * @return bool 92 | */ 93 | public function isBeingUpgraded($upgrader = null) { 94 | return $this->upgraderStatus->isThemeBeingUpgraded($this->stylesheet, $upgrader); 95 | } 96 | 97 | protected function createDebugBarExtension() { 98 | return new DebugBar\Extension($this, DebugBar\ThemePanel::class); 99 | } 100 | 101 | /** 102 | * Register a callback for filtering query arguments. 103 | * 104 | * The callback function should take one argument - an associative array of query arguments. 105 | * It should return a modified array of query arguments. 106 | * 107 | * @param callable $callback 108 | * @return void 109 | */ 110 | public function addQueryArgFilter($callback){ 111 | $this->addFilter('request_update_query_args', $callback); 112 | } 113 | 114 | /** 115 | * Register a callback for filtering arguments passed to wp_remote_get(). 116 | * 117 | * The callback function should take one argument - an associative array of arguments - 118 | * and return a modified array or arguments. See the WP documentation on wp_remote_get() 119 | * for details on what arguments are available and how they work. 120 | * 121 | * @uses add_filter() This method is a convenience wrapper for add_filter(). 122 | * 123 | * @param callable $callback 124 | * @return void 125 | */ 126 | public function addHttpRequestArgFilter($callback) { 127 | $this->addFilter('request_update_options', $callback); 128 | } 129 | 130 | /** 131 | * Register a callback for filtering theme updates retrieved from the external API. 132 | * 133 | * The callback function should take two arguments. If the theme update was retrieved 134 | * successfully, the first argument passed will be an instance of Theme_Update. Otherwise, 135 | * it will be NULL. The second argument will be the corresponding return value of 136 | * wp_remote_get (see WP docs for details). 137 | * 138 | * The callback function should return a new or modified instance of Theme_Update or NULL. 139 | * 140 | * @uses add_filter() This method is a convenience wrapper for add_filter(). 141 | * 142 | * @param callable $callback 143 | * @return void 144 | */ 145 | public function addResultFilter($callback) { 146 | $this->addFilter('request_update_result', $callback, 10, 2); 147 | } 148 | 149 | /** 150 | * Create a package instance that represents this plugin or theme. 151 | * 152 | * @return InstalledPackage 153 | */ 154 | protected function createInstalledPackage() { 155 | return new Package($this->stylesheet, $this); 156 | } 157 | } 158 | 159 | endif; 160 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/Update.php: -------------------------------------------------------------------------------- 1 | slug = $this->slug; 31 | $update->new_version = $this->version; 32 | $update->package = $this->download_url; 33 | 34 | return $update; 35 | } 36 | } 37 | 38 | endif; 39 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/UpgraderStatus.php: -------------------------------------------------------------------------------- 1 | isBeingUpgraded('plugin', $pluginFile, $upgrader); 37 | } 38 | 39 | /** 40 | * Is there an update being installed for a specific theme? 41 | * 42 | * @param string $stylesheet Theme directory name. 43 | * @param \WP_Upgrader|null $upgrader The upgrader that's performing the current update. 44 | * @return bool 45 | */ 46 | public function isThemeBeingUpgraded($stylesheet, $upgrader = null) { 47 | return $this->isBeingUpgraded('theme', $stylesheet, $upgrader); 48 | } 49 | 50 | /** 51 | * Check if a specific theme or plugin is being upgraded. 52 | * 53 | * @param string $type 54 | * @param string $id 55 | * @param \Plugin_Upgrader|\WP_Upgrader|null $upgrader 56 | * @return bool 57 | */ 58 | protected function isBeingUpgraded($type, $id, $upgrader = null) { 59 | if ( isset($upgrader) ) { 60 | list($currentType, $currentId) = $this->getThingBeingUpgradedBy($upgrader); 61 | if ( $currentType !== null ) { 62 | $this->currentType = $currentType; 63 | $this->currentId = $currentId; 64 | } 65 | } 66 | return ($this->currentType === $type) && ($this->currentId === $id); 67 | } 68 | 69 | /** 70 | * Figure out which theme or plugin is being upgraded by a WP_Upgrader instance. 71 | * 72 | * Returns an array with two items. The first item is the type of the thing that's being 73 | * upgraded: "plugin" or "theme". The second item is either the plugin basename or 74 | * the theme directory name. If we can't determine what the upgrader is doing, both items 75 | * will be NULL. 76 | * 77 | * Examples: 78 | * ['plugin', 'plugin-dir-name/plugin.php'] 79 | * ['theme', 'theme-dir-name'] 80 | * 81 | * @param \Plugin_Upgrader|\WP_Upgrader $upgrader 82 | * @return array 83 | */ 84 | private function getThingBeingUpgradedBy($upgrader) { 85 | if ( !isset($upgrader, $upgrader->skin) ) { 86 | return array(null, null); 87 | } 88 | 89 | //Figure out which plugin or theme is being upgraded. 90 | $pluginFile = null; 91 | $themeDirectoryName = null; 92 | 93 | $skin = $upgrader->skin; 94 | if ( isset($skin->theme_info) && ($skin->theme_info instanceof \WP_Theme) ) { 95 | $themeDirectoryName = $skin->theme_info->get_stylesheet(); 96 | } elseif ( $skin instanceof \Plugin_Upgrader_Skin ) { 97 | if ( isset($skin->plugin) && is_string($skin->plugin) && ($skin->plugin !== '') ) { 98 | $pluginFile = $skin->plugin; 99 | } 100 | } elseif ( $skin instanceof \Theme_Upgrader_Skin ) { 101 | if ( isset($skin->theme) && is_string($skin->theme) && ($skin->theme !== '') ) { 102 | $themeDirectoryName = $skin->theme; 103 | } 104 | } elseif ( isset($skin->plugin_info) && is_array($skin->plugin_info) ) { 105 | //This case is tricky because Bulk_Plugin_Upgrader_Skin (etc) doesn't actually store the plugin 106 | //filename anywhere. Instead, it has the plugin headers in $plugin_info. So the best we can 107 | //do is compare those headers to the headers of installed plugins. 108 | $pluginFile = $this->identifyPluginByHeaders($skin->plugin_info); 109 | } 110 | 111 | if ( $pluginFile !== null ) { 112 | return array('plugin', $pluginFile); 113 | } elseif ( $themeDirectoryName !== null ) { 114 | return array('theme', $themeDirectoryName); 115 | } 116 | return array(null, null); 117 | } 118 | 119 | /** 120 | * Identify an installed plugin based on its headers. 121 | * 122 | * @param array $searchHeaders The plugin file header to look for. 123 | * @return string|null Plugin basename ("foo/bar.php"), or NULL if we can't identify the plugin. 124 | */ 125 | private function identifyPluginByHeaders($searchHeaders) { 126 | if ( !function_exists('get_plugins') ){ 127 | require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); 128 | } 129 | 130 | $installedPlugins = get_plugins(); 131 | $matches = array(); 132 | foreach($installedPlugins as $pluginBasename => $headers) { 133 | $diff1 = array_diff_assoc($headers, $searchHeaders); 134 | $diff2 = array_diff_assoc($searchHeaders, $headers); 135 | if ( empty($diff1) && empty($diff2) ) { 136 | $matches[] = $pluginBasename; 137 | } 138 | } 139 | 140 | //It's possible (though very unlikely) that there could be two plugins with identical 141 | //headers. In that case, we can't unambiguously identify the plugin that's being upgraded. 142 | if ( count($matches) !== 1 ) { 143 | return null; 144 | } 145 | 146 | return reset($matches); 147 | } 148 | 149 | /** 150 | * @access private 151 | * 152 | * @param mixed $input 153 | * @param array $hookExtra 154 | * @return mixed Returns $input unaltered. 155 | */ 156 | public function setUpgradedThing($input, $hookExtra) { 157 | if ( !empty($hookExtra['plugin']) && is_string($hookExtra['plugin']) ) { 158 | $this->currentId = $hookExtra['plugin']; 159 | $this->currentType = 'plugin'; 160 | } elseif ( !empty($hookExtra['theme']) && is_string($hookExtra['theme']) ) { 161 | $this->currentId = $hookExtra['theme']; 162 | $this->currentType = 'theme'; 163 | } else { 164 | $this->currentType = null; 165 | $this->currentId = null; 166 | } 167 | return $input; 168 | } 169 | 170 | /** 171 | * @access private 172 | * 173 | * @param array $options 174 | * @return array 175 | */ 176 | public function setUpgradedPluginFromOptions($options) { 177 | if ( isset($options['hook_extra']['plugin']) && is_string($options['hook_extra']['plugin']) ) { 178 | $this->currentType = 'plugin'; 179 | $this->currentId = $options['hook_extra']['plugin']; 180 | } else { 181 | $this->currentType = null; 182 | $this->currentId = null; 183 | } 184 | return $options; 185 | } 186 | 187 | /** 188 | * @access private 189 | * 190 | * @param mixed $input 191 | * @return mixed Returns $input unaltered. 192 | */ 193 | public function clearUpgradedThing($input = null) { 194 | $this->currentId = null; 195 | $this->currentType = null; 196 | return $input; 197 | } 198 | } 199 | 200 | endif; 201 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/Utils.php: -------------------------------------------------------------------------------- 1 | $node) ) { 27 | $currentValue = $currentValue->$node; 28 | } else { 29 | return $default; 30 | } 31 | } 32 | 33 | return $currentValue; 34 | } 35 | 36 | /** 37 | * Get the first array element that is not empty. 38 | * 39 | * @param array $values 40 | * @param mixed|null $default Returns this value if there are no non-empty elements. 41 | * @return mixed|null 42 | */ 43 | public static function findNotEmpty($values, $default = null) { 44 | if ( empty($values) ) { 45 | return $default; 46 | } 47 | 48 | foreach ($values as $value) { 49 | if ( !empty($value) ) { 50 | return $value; 51 | } 52 | } 53 | 54 | return $default; 55 | } 56 | 57 | /** 58 | * Check if the input string starts with the specified prefix. 59 | * 60 | * @param string $input 61 | * @param string $prefix 62 | * @return bool 63 | */ 64 | public static function startsWith($input, $prefix) { 65 | $length = strlen($prefix); 66 | return (substr($input, 0, $length) === $prefix); 67 | } 68 | } 69 | 70 | endif; 71 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/Vcs/BaseChecker.php: -------------------------------------------------------------------------------- 1 | properties = $properties; 23 | } 24 | 25 | /** 26 | * @param string $name 27 | * @return mixed|null 28 | */ 29 | public function __get($name) { 30 | return array_key_exists($name, $this->properties) ? $this->properties[$name] : null; 31 | } 32 | 33 | /** 34 | * @param string $name 35 | * @param mixed $value 36 | */ 37 | public function __set($name, $value) { 38 | $this->properties[$name] = $value; 39 | } 40 | 41 | /** 42 | * @param string $name 43 | * @return bool 44 | */ 45 | public function __isset($name) { 46 | return isset($this->properties[$name]); 47 | } 48 | 49 | } 50 | 51 | endif; 52 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/Vcs/ReleaseAssetSupport.php: -------------------------------------------------------------------------------- 1 | releaseAssetsEnabled = true; 40 | $this->assetFilterRegex = $nameRegex; 41 | $this->releaseAssetPreference = $preference; 42 | } 43 | 44 | /** 45 | * Disable release assets. 46 | * 47 | * @return void 48 | * @noinspection PhpUnused -- Public API 49 | */ 50 | public function disableReleaseAssets() { 51 | $this->releaseAssetsEnabled = false; 52 | $this->assetFilterRegex = null; 53 | } 54 | 55 | /** 56 | * Does the specified asset match the name regex? 57 | * 58 | * @param mixed $releaseAsset Data type and structure depend on the host/API. 59 | * @return bool 60 | */ 61 | protected function matchesAssetFilter($releaseAsset) { 62 | if ( $this->assetFilterRegex === null ) { 63 | //The default is to accept all assets. 64 | return true; 65 | } 66 | 67 | $name = $this->getFilterableAssetName($releaseAsset); 68 | if ( !is_string($name) ) { 69 | return false; 70 | } 71 | return (bool)preg_match($this->assetFilterRegex, $releaseAsset->name); 72 | } 73 | 74 | /** 75 | * Get the part of asset data that will be checked against the filter regex. 76 | * 77 | * @param mixed $releaseAsset 78 | * @return string|null 79 | */ 80 | abstract protected function getFilterableAssetName($releaseAsset); 81 | } 82 | 83 | endif; -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/Vcs/ReleaseFilteringFeature.php: -------------------------------------------------------------------------------- 1 | 100 ) { 39 | throw new \InvalidArgumentException(sprintf( 40 | 'The max number of releases is too high (%d). It must be 100 or less.', 41 | $maxReleases 42 | )); 43 | } else if ( $maxReleases < 1 ) { 44 | throw new \InvalidArgumentException(sprintf( 45 | 'The max number of releases is too low (%d). It must be at least 1.', 46 | $maxReleases 47 | )); 48 | } 49 | 50 | $this->releaseFilterCallback = $callback; 51 | $this->releaseFilterByType = $releaseTypes; 52 | $this->releaseFilterMaxReleases = $maxReleases; 53 | return $this; 54 | } 55 | 56 | /** 57 | * Filter releases by their version number. 58 | * 59 | * @param string $regex A regular expression. The release version number must match this regex. 60 | * @param int $releaseTypes 61 | * @param int $maxReleasesToExamine 62 | * @return $this 63 | * @noinspection PhpUnused -- Public API 64 | */ 65 | public function setReleaseVersionFilter( 66 | $regex, 67 | $releaseTypes = Api::RELEASE_FILTER_SKIP_PRERELEASE, 68 | $maxReleasesToExamine = 20 69 | ) { 70 | return $this->setReleaseFilter( 71 | function ($versionNumber) use ($regex) { 72 | return (preg_match($regex, $versionNumber) === 1); 73 | }, 74 | $releaseTypes, 75 | $maxReleasesToExamine 76 | ); 77 | } 78 | 79 | /** 80 | * @param string $versionNumber The detected release version number. 81 | * @param object $releaseObject Varies depending on the host/API. 82 | * @return bool 83 | */ 84 | protected function matchesCustomReleaseFilter($versionNumber, $releaseObject) { 85 | if ( !is_callable($this->releaseFilterCallback) ) { 86 | return true; //No custom filter. 87 | } 88 | return call_user_func($this->releaseFilterCallback, $versionNumber, $releaseObject); 89 | } 90 | 91 | /** 92 | * @return bool 93 | */ 94 | protected function shouldSkipPreReleases() { 95 | //Maybe this could be a bitfield in the future, if we need to support 96 | //more release types. 97 | return ($this->releaseFilterByType !== Api::RELEASE_FILTER_ALL); 98 | } 99 | 100 | /** 101 | * @return bool 102 | */ 103 | protected function hasCustomReleaseFilter() { 104 | return isset($this->releaseFilterCallback) && is_callable($this->releaseFilterCallback); 105 | } 106 | } 107 | 108 | endif; -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/Vcs/ThemeUpdateChecker.php: -------------------------------------------------------------------------------- 1 | api = $api; 24 | 25 | parent::__construct($api->getRepositoryUrl(), $stylesheet, $customSlug, $checkPeriod, $optionName); 26 | 27 | $this->api->setHttpFilterName($this->getUniqueName('request_update_options')); 28 | $this->api->setStrategyFilterName($this->getUniqueName('vcs_update_detection_strategies')); 29 | $this->api->setSlug($this->slug); 30 | } 31 | 32 | public function requestUpdate() { 33 | $api = $this->api; 34 | $api->setLocalDirectory($this->package->getAbsoluteDirectoryPath()); 35 | 36 | $update = new Theme\Update(); 37 | $update->slug = $this->slug; 38 | 39 | //Figure out which reference (tag or branch) we'll use to get the latest version of the theme. 40 | $updateSource = $api->chooseReference($this->branch); 41 | if ( $updateSource ) { 42 | $ref = $updateSource->name; 43 | $update->download_url = $updateSource->downloadUrl; 44 | } else { 45 | do_action( 46 | 'puc_api_error', 47 | new \WP_Error( 48 | 'puc-no-update-source', 49 | 'Could not retrieve version information from the repository. ' 50 | . 'This usually means that the update checker either can\'t connect ' 51 | . 'to the repository or it\'s configured incorrectly.' 52 | ), 53 | null, null, $this->slug 54 | ); 55 | $ref = $this->branch; 56 | } 57 | 58 | //Get headers from the main stylesheet in this branch/tag. Its "Version" header and other metadata 59 | //are what the WordPress install will actually see after upgrading, so they take precedence over releases/tags. 60 | $remoteHeader = $this->package->getFileHeader($api->getRemoteFile('style.css', $ref)); 61 | $update->version = Utils::findNotEmpty(array( 62 | $remoteHeader['Version'], 63 | Utils::get($updateSource, 'version'), 64 | )); 65 | 66 | //The details URL defaults to the Theme URI header or the repository URL. 67 | $update->details_url = Utils::findNotEmpty(array( 68 | $remoteHeader['ThemeURI'], 69 | $this->package->getHeaderValue('ThemeURI'), 70 | $this->metadataUrl, 71 | )); 72 | 73 | if ( empty($update->version) ) { 74 | //It looks like we didn't find a valid update after all. 75 | $update = null; 76 | } 77 | 78 | $update = $this->filterUpdateResult($update); 79 | return $update; 80 | } 81 | } 82 | 83 | endif; 84 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/Vcs/VcsCheckerMethods.php: -------------------------------------------------------------------------------- 1 | branch = $branch; 20 | return $this; 21 | } 22 | 23 | /** 24 | * Set authentication credentials. 25 | * 26 | * @param array|string $credentials 27 | * @return $this 28 | */ 29 | public function setAuthentication($credentials) { 30 | $this->api->setAuthentication($credentials); 31 | return $this; 32 | } 33 | 34 | /** 35 | * @return Api 36 | */ 37 | public function getVcsApi() { 38 | return $this->api; 39 | } 40 | 41 | public function getUpdate() { 42 | $update = parent::getUpdate(); 43 | 44 | if ( isset($update) && !empty($update->download_url) ) { 45 | $update->download_url = $this->api->signDownloadUrl($update->download_url); 46 | } 47 | 48 | return $update; 49 | } 50 | 51 | public function onDisplayConfiguration($panel) { 52 | parent::onDisplayConfiguration($panel); 53 | $panel->row('Branch', $this->branch); 54 | $panel->row('Authentication enabled', $this->api->isAuthenticationEnabled() ? 'Yes' : 'No'); 55 | $panel->row('API client', get_class($this->api)); 56 | } 57 | } 58 | 59 | endif; -------------------------------------------------------------------------------- /vendor/plugin-update-checker/Puc/v5p4/WpCliCheckTrigger.php: -------------------------------------------------------------------------------- 1 | componentType = $componentType; 42 | $this->scheduler = $scheduler; 43 | 44 | if ( !defined('WP_CLI') || !class_exists(WP_CLI::class, false) ) { 45 | return; //Nothing to do if WP-CLI is not available. 46 | } 47 | 48 | /* 49 | * We can't hook directly into wp_update_plugins(), but we can hook into the WP-CLI 50 | * commands that call it. We'll use the "before_invoke:xyz" hook to trigger update checks. 51 | */ 52 | foreach ($this->getRelevantCommands() as $command) { 53 | WP_CLI::add_hook('before_invoke:' . $command, [$this, 'triggerUpdateCheckOnce']); 54 | } 55 | } 56 | 57 | private function getRelevantCommands() { 58 | $result = []; 59 | foreach (['status', 'list', 'update'] as $subcommand) { 60 | $result[] = $this->componentType . ' ' . $subcommand; 61 | } 62 | return $result; 63 | } 64 | 65 | /** 66 | * Trigger a potential update check once. 67 | * 68 | * @param mixed $input 69 | * @return mixed The input value, unchanged. 70 | * @internal This method is public so that it can be used as a WP-CLI hook callback. 71 | * It should not be called directly. 72 | * 73 | */ 74 | public function triggerUpdateCheckOnce($input = null) { 75 | if ( $this->wasCheckTriggered ) { 76 | return $input; 77 | } 78 | 79 | $this->wasCheckTriggered = true; 80 | $this->scheduler->maybeCheckForUpdates(); 81 | 82 | return $input; 83 | } 84 | } -------------------------------------------------------------------------------- /vendor/plugin-update-checker/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "yahnis-elsts/plugin-update-checker", 3 | "type": "library", 4 | "description": "A custom update checker for WordPress plugins and themes. Useful if you can't host your plugin in the official WP repository but still want it to support automatic updates.", 5 | "keywords": ["wordpress", "plugin updates", "automatic updates", "theme updates"], 6 | "homepage": "https://github.com/YahnisElsts/plugin-update-checker/", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Yahnis Elsts", 11 | "email": "whiteshadow@w-shadow.com", 12 | "homepage": "https://w-shadow.com/", 13 | "role": "Developer" 14 | } 15 | ], 16 | "require": { 17 | "php": ">=5.6.20", 18 | "ext-json": "*" 19 | }, 20 | "autoload": { 21 | "files": ["load-v5p4.php"] 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/css/puc-debug-bar.css: -------------------------------------------------------------------------------- 1 | .puc-debug-bar-panel-v5 pre { 2 | margin-top: 0; 3 | } 4 | 5 | /* Style the debug data table to match "widefat" table style used by WordPress. */ 6 | table.puc-debug-data { 7 | width: 100%; 8 | clear: both; 9 | margin: 0; 10 | 11 | border-spacing: 0; 12 | background-color: #f9f9f9; 13 | 14 | border-radius: 3px; 15 | border: 1px solid #dfdfdf; 16 | border-collapse: separate; 17 | } 18 | 19 | table.puc-debug-data * { 20 | word-wrap: break-word; 21 | } 22 | 23 | table.puc-debug-data th { 24 | width: 11em; 25 | padding: 7px 7px 8px; 26 | text-align: left; 27 | 28 | font-family: "Georgia", "Times New Roman", "Bitstream Charter", "Times", serif; 29 | font-weight: 400; 30 | font-size: 14px; 31 | line-height: 1.3em; 32 | text-shadow: rgba(255, 255, 255, 0.804) 0 1px 0; 33 | } 34 | 35 | table.puc-debug-data td, table.puc-debug-data th { 36 | border-width: 1px 0; 37 | border-style: solid; 38 | 39 | border-top-color: #fff; 40 | border-bottom-color: #dfdfdf; 41 | 42 | text-transform: none; 43 | } 44 | 45 | table.puc-debug-data td { 46 | color: #555; 47 | font-size: 12px; 48 | padding: 4px 7px 2px; 49 | vertical-align: top; 50 | } 51 | 52 | .puc-ajax-response { 53 | border: 1px solid #dfdfdf; 54 | border-radius: 3px; 55 | padding: 0.5em; 56 | margin: 5px 0; 57 | background-color: white; 58 | } 59 | 60 | .puc-ajax-nonce { 61 | display: none; 62 | } 63 | 64 | .puc-ajax-response dt { 65 | margin: 0; 66 | } 67 | 68 | .puc-ajax-response dd { 69 | margin: 0 0 1em; 70 | } 71 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/js/debug-bar.js: -------------------------------------------------------------------------------- 1 | jQuery(function($) { 2 | 3 | function runAjaxAction(button, action) { 4 | button = $(button); 5 | var panel = button.closest('.puc-debug-bar-panel-v5'); 6 | var responseBox = button.closest('td').find('.puc-ajax-response'); 7 | 8 | responseBox.text('Processing...').show(); 9 | $.post( 10 | ajaxurl, 11 | { 12 | action : action, 13 | uid : panel.data('uid'), 14 | _wpnonce: panel.data('nonce') 15 | }, 16 | function(data) { 17 | //The response contains HTML that should already be escaped in server-side code. 18 | //phpcs:ignore WordPressVIPMinimum.JS.HTMLExecutingFunctions.html 19 | responseBox.html(data); 20 | }, 21 | 'html' 22 | ); 23 | } 24 | 25 | $('.puc-debug-bar-panel-v5 input[name="puc-check-now-button"]').on('click', function() { 26 | runAjaxAction(this, 'puc_v5_debug_check_now'); 27 | return false; 28 | }); 29 | 30 | $('.puc-debug-bar-panel-v5 input[name="puc-request-info-button"]').on('click', function() { 31 | runAjaxAction(this, 'puc_v5_debug_request_info'); 32 | return false; 33 | }); 34 | 35 | 36 | // Debug Bar uses the panel class name as part of its link and container IDs. This means we can 37 | // end up with multiple identical IDs if more than one plugin uses the update checker library. 38 | // Fix it by replacing the class name with the plugin slug. 39 | var panels = $('#debug-menu-targets').find('.puc-debug-bar-panel-v5'); 40 | panels.each(function() { 41 | var panel = $(this); 42 | var uid = panel.data('uid'); 43 | var target = panel.closest('.debug-menu-target'); 44 | 45 | //Change the panel wrapper ID. 46 | target.attr('id', 'debug-menu-target-puc-' + uid); 47 | 48 | //Change the menu link ID as well and point it at the new target ID. 49 | $('#debug-bar-menu').find('.puc-debug-menu-link-' + uid) 50 | .closest('.debug-menu-link') 51 | .attr('id', 'debug-menu-link-puc-' + uid) 52 | .attr('href', '#' + target.attr('id')); 53 | }); 54 | }); -------------------------------------------------------------------------------- /vendor/plugin-update-checker/languages/plugin-update-checker-ca.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertdevore/custom-update-request-modifier/a8ec4ca9543b54a495f3da44abd9a2ce2e388e1b/vendor/plugin-update-checker/languages/plugin-update-checker-ca.mo -------------------------------------------------------------------------------- /vendor/plugin-update-checker/languages/plugin-update-checker-ca.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: plugin-update-checker\n" 4 | "POT-Creation-Date: 2017-11-24 17:02+0200\n" 5 | "PO-Revision-Date: 2019-09-25 18:15+0200\n" 6 | "Language-Team: \n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=UTF-8\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | "X-Generator: Poedit 2.2.3\n" 11 | "X-Poedit-Basepath: ..\n" 12 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 13 | "X-Poedit-SourceCharset: UTF-8\n" 14 | "X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" 15 | "Last-Translator: \n" 16 | "Language: ca\n" 17 | "X-Poedit-SearchPath-0: .\n" 18 | 19 | #: Puc/v4p3/Plugin/UpdateChecker.php:395 20 | msgid "Check for updates" 21 | msgstr "Comprova si hi ha actualitzacions" 22 | 23 | #: Puc/v4p3/Plugin/UpdateChecker.php:548 24 | #, php-format 25 | msgctxt "the plugin title" 26 | msgid "The %s plugin is up to date." 27 | msgstr "L’extensió %s està actualitzada." 28 | 29 | #: Puc/v4p3/Plugin/UpdateChecker.php:550 30 | #, php-format 31 | msgctxt "the plugin title" 32 | msgid "A new version of the %s plugin is available." 33 | msgstr "Una nova versió de l’extensió %s està disponible." 34 | 35 | #: Puc/v4p3/Plugin/UpdateChecker.php:552 36 | #, php-format 37 | msgctxt "the plugin title" 38 | msgid "Could not determine if updates are available for %s." 39 | msgstr "No s’ha pogut determinar si hi ha actualitzacions per a %s." 40 | 41 | #: Puc/v4p3/Plugin/UpdateChecker.php:558 42 | #, php-format 43 | msgid "Unknown update checker status \"%s\"" 44 | msgstr "Estat del comprovador d’actualitzacions desconegut \"%s\"" 45 | 46 | #: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 47 | msgid "There is no changelog available." 48 | msgstr "No hi ha cap registre de canvis disponible." 49 | -------------------------------------------------------------------------------- /vendor/plugin-update-checker/languages/plugin-update-checker-cs_CZ.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robertdevore/custom-update-request-modifier/a8ec4ca9543b54a495f3da44abd9a2ce2e388e1b/vendor/plugin-update-checker/languages/plugin-update-checker-cs_CZ.mo -------------------------------------------------------------------------------- /vendor/plugin-update-checker/languages/plugin-update-checker-cs_CZ.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: plugin-update-checker\n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "POT-Creation-Date: 2017-05-20 10:53+0300\n" 6 | "PO-Revision-Date: 2017-07-05 15:39+0000\n" 7 | "Last-Translator: Vojtěch Sajdl
' . wp_kses_post( 66 | sprintf( 67 | __( 68 | 'The plugin has been deactivated because it cannot be used on WordPress.com-hosted websites. %s', 69 | 'wpcom-plugin-check' 70 | ), 71 | '' . __( 'Learn more', 'wpcom-plugin-check' ) . '' 72 | ) 73 | ) . '
'; 74 | echo '%s
', 90 | __( 'Plugin Activation Blocked', 'wpcom-plugin-check' ), 91 | __( 'This plugin cannot be activated on WordPress.com-hosted websites. It is restricted due to concerns about WordPress.com policies impacting the community.', 'wpcom-plugin-check' ), 92 | esc_url( $this->learnMoreLink ), 93 | __( 'Learn more', 'wpcom-plugin-check' ) 94 | ) 95 | ), 96 | esc_html__('Plugin Activation Blocked', 'wpcom-plugin-check'), 97 | [ 'back_link' => true ] 98 | ); 99 | } 100 | } 101 | 102 | /** 103 | * Set a flag when the plugin is deactivated. 104 | * 105 | * @return void 106 | */ 107 | public function setDeactivationFlag(): void { 108 | add_option( 'wpcom_plugin_deactivation_notice', $this->learnMoreLink ); 109 | } 110 | } 111 | 112 | // Initialize the class. 113 | new WPComPluginHandler( plugin_basename( __FILE__ ), 'https://example.com/community-statement' ); 114 | --------------------------------------------------------------------------------