Changeset 3154429
- Timestamp:
- 09/19/2024 10:06:13 AM (17 months ago)
- Location:
- pmpr-ir/trunk
- Files:
-
- 8 added
- 9 deleted
- 38 edited
-
build/css/admin-1.3.8.css (deleted)
-
build/css/admin-1.3.8.rtl.css (deleted)
-
build/css/admin-1.4.0.css (added)
-
build/css/admin-1.4.0.rtl.css (added)
-
build/js/admin-1.3.8.js (deleted)
-
build/js/admin-1.3.8.js.LICENSE.txt (deleted)
-
build/js/admin-1.4.0.js (added)
-
build/js/admin-1.4.0.js.LICENSE.txt (added)
-
build/js/upload-1.3.8.js (deleted)
-
build/js/upload-1.3.8.js.LICENSE.txt (deleted)
-
build/js/upload-1.4.0.js (added)
-
build/js/upload-1.4.0.js.LICENSE.txt (added)
-
pmpr-ir.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
src/Pmpr/Plugin/Pmpr/API.php (modified) (7 diffs)
-
src/Pmpr/Plugin/Pmpr/Ajax.php (modified) (10 diffs)
-
src/Pmpr/Plugin/Pmpr/Asset.php (modified) (3 diffs)
-
src/Pmpr/Plugin/Pmpr/Component/Ajax.php (modified) (5 diffs)
-
src/Pmpr/Plugin/Pmpr/Component/Base.php (modified) (18 diffs)
-
src/Pmpr/Plugin/Pmpr/Component/Common.php (modified) (5 diffs)
-
src/Pmpr/Plugin/Pmpr/Component/Component.php (modified) (2 diffs)
-
src/Pmpr/Plugin/Pmpr/Component/Cover.php (modified) (3 diffs)
-
src/Pmpr/Plugin/Pmpr/Component/Custom.php (modified) (3 diffs)
-
src/Pmpr/Plugin/Pmpr/Component/Item.php (modified) (11 diffs)
-
src/Pmpr/Plugin/Pmpr/Component/ListTable/Cover/Install.php (modified) (2 diffs)
-
src/Pmpr/Plugin/Pmpr/Component/ListTable/Install.php (modified) (9 diffs)
-
src/Pmpr/Plugin/Pmpr/Component/ListTable/Installed.php (modified) (13 diffs)
-
src/Pmpr/Plugin/Pmpr/Component/ListTable/ListTable.php (modified) (4 diffs)
-
src/Pmpr/Plugin/Pmpr/Component/ListTable/Module/Install.php (modified) (2 diffs)
-
src/Pmpr/Plugin/Pmpr/Component/ListTable/Update/Installed.php (modified) (2 diffs)
-
src/Pmpr/Plugin/Pmpr/Component/Manager/Initiator.php (modified) (4 diffs)
-
src/Pmpr/Plugin/Pmpr/Component/Module.php (modified) (3 diffs)
-
src/Pmpr/Plugin/Pmpr/Component/Process.php (modified) (4 diffs)
-
src/Pmpr/Plugin/Pmpr/Component/Update.php (modified) (6 diffs)
-
src/Pmpr/Plugin/Pmpr/Container/Container.php (modified) (3 diffs)
-
src/Pmpr/Plugin/Pmpr/Container/Storage.php (modified) (2 diffs)
-
src/Pmpr/Plugin/Pmpr/Helper/Common.php (modified) (2 diffs)
-
src/Pmpr/Plugin/Pmpr/Helper/Component.php (modified) (11 diffs)
-
src/Pmpr/Plugin/Pmpr/Helper/HTML.php (modified) (8 diffs)
-
src/Pmpr/Plugin/Pmpr/Helper/Helper.php (modified) (2 diffs)
-
src/Pmpr/Plugin/Pmpr/Helper/Server.php (modified) (2 diffs)
-
src/Pmpr/Plugin/Pmpr/Helper/Tool.php (added)
-
src/Pmpr/Plugin/Pmpr/Interfaces/ConstantInterface.php (deleted)
-
src/Pmpr/Plugin/Pmpr/Interfaces/Constants.php (added)
-
src/Pmpr/Plugin/Pmpr/Manager.php (modified) (16 diffs)
-
src/Pmpr/Plugin/Pmpr/Pmpr.php (modified) (17 diffs)
-
src/Pmpr/Plugin/Pmpr/Queue.php (modified) (5 diffs)
-
src/Pmpr/Plugin/Pmpr/REST/Controller.php (modified) (5 diffs)
-
src/Pmpr/Plugin/Pmpr/Setting.php (modified) (17 diffs)
-
src/Pmpr/Plugin/Pmpr/Traits/CommonTrait.php (deleted)
-
src/Pmpr/Plugin/Pmpr/Traits/SettingTrait.php (deleted)
-
template/modal.php (modified) (4 diffs)
-
vendor/composer/autoload_classmap.php (modified) (2 diffs)
-
vendor/composer/autoload_static.php (modified) (2 diffs)
-
vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pmpr-ir/trunk/pmpr-ir.php
r3152426 r3154429 4 4 Plugin Name: Pmpr-IR 5 5 Description: Pmpr official Wordpress plugin. Pmpr development team offers high quality products and services on Wordpress. 6 Version: 1. 3.86 Version: 1.4.0 7 7 Requires PHP: 7.4 8 8 Author: Pmpr Development Team … … 22 22 @define('PR__PLG__PMPR', 'pmpr-ir'); 23 23 @define('PR__PLG__PMPR__DIR', __DIR__); 24 @define('PR__PLG__PMPR__VER', '1. 3.8');24 @define('PR__PLG__PMPR__VER', '1.4.0'); 25 25 @define('PR__PLG__PMPR__NAME', plugin_basename(__DIR__) . '/' . basename(__FILE__)); 26 26 -
pmpr-ir/trunk/readme.txt
r3152426 r3154429 5 5 Tags: wordpress, development, programming, pmpr, دکتر, محمدپور, برنامه نویسی, توسعه, وردپرس 6 6 Requires at least: 5.3 7 Tested up to: 6.6. 18 Stable tag: 1. 3.87 Tested up to: 6.6.2 8 Stable tag: 1.4.0 9 9 Requires PHP: 7.4 10 10 License: GPLv2 … … 40 40 41 41 == Changelog == 42 = 1.4.0 = 43 * بهبود کارایی و رفع برخی باگها 42 44 = 1.3.8 = 43 45 * رفع برخی باگها -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/API.php
r3125582 r3154429 4 4 5 5 use Pmpr\Plugin\Pmpr\Container\Container; 6 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 6 7 use WP_Error; 7 8 … … 21 22 private function get($query, $params = [], $default = []) 22 23 { 24 $default['host'] = get_home_url(); 25 $default['api_key'] = $this->getHelper()->getSetting()->getAPIKey(); 26 23 27 $params = wp_parse_args($params, $default); 24 28 … … 78 82 { 79 83 $result = false; 80 if (strlen($apikey) === self::APIKEY_LENGTH) {84 if (strlen($apikey) === Constants::APIKEY_LENGTH) { 81 85 82 86 $response = $this->get('/domain-manager/check-apikey', [ … … 106 110 { 107 111 return $this->get('/component/get-items', $args, [ 108 self::IPS => $this->getHelper()->getServer()->getIPs(), 109 self::TYPE => self::MODULE, 110 self::PAGE => 1, 111 self::SEARCH => '', 112 self::API_KEY => $this->getAPIKey(), 113 self::PER_PAGE => 12, 114 self::REQUIRED => false, 112 Constants::IPS => $this->getHelper()->getServer()->getIPs(), 113 Constants::TYPE => Constants::MODULE, 114 Constants::PAGE => 1, 115 Constants::SEARCH => '', 116 Constants::PER_PAGE => 12, 117 Constants::REQUIRED => false, 115 118 ]); 116 119 } … … 122 125 * @return array|mixed|WP_Error 123 126 */ 124 public function getComponent(string $name, string $type = self::MODULE)127 public function getComponent(string $name, string $type = Constants::MODULE) 125 128 { 126 129 return $this->get('/component/get-item', [ 127 self::IPS => $this->getHelper()->getServer()->getIPs(), 128 self::TYPE => $type, 129 self::NAME => $name, 130 self::API_KEY => $this->getAPIKey(), 130 Constants::IPS => $this->getHelper()->getServer()->getIPs(), 131 Constants::TYPE => $type, 132 Constants::NAME => $name, 131 133 ]); 132 134 } … … 138 140 { 139 141 return $this->get('/component/get-plugin-tab', [ 140 self::IPS => $this->getHelper()->getServer()->getIPs(), 141 self::API_KEY => $this->getAPIKey(), 142 Constants::IPS => $this->getHelper()->getServer()->getIPs(), 142 143 ]); 143 144 } … … 148 149 public function getRESTApiEndpoint(): string 149 150 { 150 return "{$this->get PMPRBaseURL()}/wp-json/pmpr/v1";151 return "{$this->getHelper()->getTool()->getPMPRBaseURL()}/wp-json/pmpr/v1"; 151 152 } 152 153 } -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Ajax.php
r3145930 r3154429 4 4 5 5 use Exception; 6 use Pmpr\Plugin\Pmpr\Component\Common;7 6 use Pmpr\Plugin\Pmpr\Component\Process; 8 7 use Pmpr\Plugin\Pmpr\Container\Container; 8 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 9 9 use Pmpr\Plugin\Pmpr\Traits\ManagerTrait; 10 10 use WP_Error; … … 18 18 use ManagerTrait; 19 19 20 const RUN_JOB = self::PLUGIN_PREFIX . 'run_job';21 const CHECK_JOB = self::PLUGIN_PREFIX . 'check_job';22 const SAVE_APIKEY = self::PLUGIN_PREFIX . 'save_apikey';23 const FETCH_API_KEY = self::PLUGIN_PREFIX . 'fetch_api_key';24 const REGENERATE_STATIC_RESOURCES = self::PLUGIN_PREFIX . 'regenerate_static_resources';20 const RUN_JOB = Constants::PLUGIN_PREFIX . 'run_job'; 21 const CHECK_JOB = Constants::PLUGIN_PREFIX . 'check_job'; 22 const SAVE_APIKEY = Constants::PLUGIN_PREFIX . 'save_apikey'; 23 const FETCH_API_KEY = Constants::PLUGIN_PREFIX . 'fetch_api_key'; 24 const REGENERATE_STATIC_RESOURCES = Constants::PLUGIN_PREFIX . 'regenerate_static_resources'; 25 25 26 26 const ACTIONS = [ … … 42 42 $success = false; 43 43 $result = ''; 44 if ($this-> isRequirementsSatisfied()) {44 if ($this->getHelper()->getComponent()->isRequirementsSatisfied()) { 45 45 46 46 if (current_user_can('manage_options')) { … … 50 50 $componentHelper = $this->getHelper()->getComponent(); 51 51 52 $job = $serverHelper->getPost( self::JOB);53 $name = $serverHelper->getPost( self::NAME);52 $job = $serverHelper->getPost(Constants::JOB); 53 $name = $serverHelper->getPost(Constants::NAME); 54 54 55 55 $manager = $this->getManager(); … … 139 139 } 140 140 break; 141 case self::INSTALL:141 case Constants::INSTALL: 142 142 if (current_user_can('install_plugins')) { 143 143 … … 156 156 157 157 $result = $componentObject->createAction([ 158 self::JOB => 'activate',159 self::COLOR => 'primary',160 self::TITLE => __('Activate', PR__PLG__PMPR),158 Constants::JOB => 'activate', 159 Constants::COLOR => 'primary', 160 Constants::TITLE => __('Activate', PR__PLG__PMPR), 161 161 ]); 162 162 … … 194 194 195 195 $result = $componentHelper->getObject($name)->createAction([ 196 self::TITLE => __('Active', PR__PLG__PMPR),197 self::ENABLE => false,196 Constants::TITLE => __('Active', PR__PLG__PMPR), 197 Constants::ENABLE => false, 198 198 ]); 199 199 } else { … … 231 231 } 232 232 233 $this-> ajaxResponse($result, $success, false);233 $this->getHelper()->getServer()->ajaxResponse($result, $success, false); 234 234 } 235 235 … … 250 250 } 251 251 252 $this-> ajaxResponse($response, $success, false);252 $this->getHelper()->getServer()->ajaxResponse($response, $success, false); 253 253 } 254 254 … … 266 266 $message = __('Your request is not valid', PR__PLG__PMPR); 267 267 } 268 $this-> ajaxResponse($message, $success, false);268 $this->getHelper()->getServer()->ajaxResponse($message, $success, false); 269 269 } 270 270 -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Asset.php
r3148079 r3154429 5 5 use Pmpr\Plugin\Pmpr\Component\Ajax as ComponentAjax; 6 6 use Pmpr\Plugin\Pmpr\Container\Container; 7 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 7 8 8 9 /** … … 25 26 { 26 27 $this->getHelper()->getHTML()->renderElement('div', [ 27 self::ID => 'pmpr_dialog',28 Constants::ID => 'pmpr_dialog', 28 29 'class' => 'hidden pmpr-plg-dialog', 29 30 ]); … … 45 46 if ($this->getHelper()->getComponent()->isRequiredInstalled()) { 46 47 47 $page = $this->getHelper()->getServer()->getGet( self::PAGE, '');48 if ($page && strpos($page, self::PLUGIN_PREFIX) !== false) {48 $page = $this->getHelper()->getServer()->getGet(Constants::PAGE, ''); 49 if ($page && strpos($page, Constants::PLUGIN_PREFIX) !== false) { 49 50 50 51 wp_enqueue_script(self::HANDLE_PREFIX . 'admin', $assetHelper->getURL("js/admin-{$ver}.js"), ['cmn__fndtn-helper', 'cmn__fndtn-backend-helper'], PR__PLG__PMPR__VER); -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Component/Ajax.php
r3078042 r3154429 4 4 5 5 use Pmpr\Plugin\Pmpr\Container\Container; 6 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 6 7 7 8 /** … … 11 12 class Ajax extends Container 12 13 { 13 const SEARCH_COMPONENTS = self::PLUGIN_PREFIX . '_search_components';14 const SEARCH_INSTALLED_COMPONENTS = self::PLUGIN_PREFIX . '_search_installed_components';14 const SEARCH_COMPONENTS = Constants::PLUGIN_PREFIX . '_search_components'; 15 const SEARCH_INSTALLED_COMPONENTS = Constants::PLUGIN_PREFIX . '_search_installed_components'; 15 16 16 17 const ACTIONS = [ … … 47 48 } 48 49 49 $this->ajaxResponse([50 $this->getHelper()->getServer()->ajaxResponse([ 50 51 'result' => $result, 51 52 'filters' => $filters, … … 75 76 } 76 77 77 $this->ajaxResponse([78 $this->getHelper()->getServer()->ajaxResponse([ 78 79 'table' => $table, 79 80 'search' => $search, … … 90 91 if (!$type) { 91 92 92 $type = $this->getHelper()->getServer()->getPost( self::TYPE, self::MODULE);93 $type = $this->getHelper()->getServer()->getPost(Constants::TYPE, Constants::MODULE); 93 94 } 94 95 $object = null; 95 96 switch ($type) { 96 case self::MODULE:97 case Constants::MODULE: 97 98 $object = Module::getInstance(); 98 99 break; 99 case self::COVER:100 case Constants::COVER: 100 101 $object = Cover::getInstance(); 101 102 break; 102 case self::CUSTOM:103 case Constants::CUSTOM: 103 104 $object = Custom::getInstance(); 104 105 break; -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Component/Base.php
r3140998 r3154429 8 8 use Pmpr\Plugin\Pmpr\Component\Manager\Skin\Upgrader; 9 9 use Pmpr\Plugin\Pmpr\Container\Container; 10 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 10 11 use Pmpr\Plugin\Pmpr\Traits\ManagerTrait; 11 12 … … 22 23 */ 23 24 protected array $args = [ 24 self::PRIVATE => false,25 Constants::PRIVATE => false, 25 26 ]; 26 27 … … 39 40 if (!$this->isPrivate()) { 40 41 41 $this->addArg( self::MENU_SLUG, self::PLUGIN_PREFIX . $this->getName());42 $this->addArg(Constants::MENU_SLUG, Constants::PLUGIN_PREFIX . $this->getName()); 42 43 } 43 44 … … 50 51 public function isPrivate(): bool 51 52 { 52 return (bool)$this->getArg( self::PRIVATE);53 return (bool)$this->getArg(Constants::PRIVATE); 53 54 } 54 55 … … 59 60 public function getType(): string 60 61 { 61 return $this->getArg( self::TYPE);62 return $this->getArg(Constants::TYPE); 62 63 } 63 64 … … 68 69 public function getName(): string 69 70 { 70 return $this->getArg( self::NAME);71 return $this->getArg(Constants::NAME); 71 72 } 72 73 … … 76 77 public function getMenuSlug(): string 77 78 { 78 return $this->getArg( self::MENU_SLUG);79 return $this->getArg(Constants::MENU_SLUG); 79 80 } 80 81 … … 150 151 { 151 152 return $this->getHelper()->getServer()->getAdminURL([ 152 self::PAGE => $this->getMenuSlug(),153 Constants::PAGE => $this->getMenuSlug(), 153 154 ]); 154 155 } … … 177 178 public function adminMenu() 178 179 { 179 $menuTitle = $this->getArg( self::MENU_TITLE);180 $menuTitle = $this->getArg(Constants::MENU_TITLE); 180 181 if (!$menuTitle) { 181 182 182 $menuTitle = $this->getArg( self::PLURAL_NAME);183 $menuTitle = $this->getArg(Constants::PLURAL_NAME); 183 184 } 184 185 185 186 add_submenu_page( 186 187 PR__PLG__PMPR, 187 sprintf($this->getArg('page_title'), $this->getArg( self::PLURAL_NAME)),188 sprintf($this->getArg('page_title'), $this->getArg(Constants::PLURAL_NAME)), 188 189 $this->updateMenuTitle($menuTitle), 189 190 apply_filters('pmpr_menu_capability', 'manage_options'), 190 191 $this->getMenuSlug(), 191 192 [$this, 'pageOutput'], 192 $this->getArg( self::POSITION, 0)193 $this->getArg(Constants::POSITION, 0) 193 194 ); 194 195 … … 210 211 $serverHelper = $this->getHelper()->getServer(); 211 212 212 $tab = $serverHelper->getGet( self::TAB);213 $context = $serverHelper->getGet( self::CONTEXT);213 $tab = $serverHelper->getGet(Constants::TAB); 214 $context = $serverHelper->getGet(Constants::CONTEXT); 214 215 215 216 $this->render($context, $tab); … … 225 226 226 227 $serverHelper = $this->getHelper()->getServer(); 227 if ( self::INSTALL === $context) {228 229 $prefix = self::INSTALL;228 if (Constants::INSTALL === $context) { 229 230 $prefix = Constants::INSTALL; 230 231 if ('upload-component' === $serverHelper->getRequest('action')) { 231 232 … … 240 241 } 241 242 242 $parameters[ self::TAB] = $tab;243 $parameters[ self::TITLE] = sprintf($mask, $this->getArg(self::SINGULAR_NAME));243 $parameters[Constants::TAB] = $tab; 244 $parameters[Constants::TITLE] = sprintf($mask, $this->getArg(Constants::SINGULAR_NAME)); 244 245 } else { 245 246 246 $prefix = self::INSTALLED;247 $parameters[ self::TITLE] = $this->getArg(self::PLURAL_NAME);247 $prefix = Constants::INSTALLED; 248 $parameters[Constants::TITLE] = $this->getArg(Constants::PLURAL_NAME); 248 249 } 249 250 … … 275 276 276 277 $this->initListTables(); 277 if ( self::INSTALL === $context) {278 if (Constants::INSTALL === $context) { 278 279 279 280 $table = $this->getInstall(); … … 286 287 $parameters = [ 287 288 's' => $this->getHelper()->getServer()->getRequest('s', ''), 288 self::STATUS => $status,289 Constants::STATUS => $status, 289 290 ]; 290 291 $table->prepare_items(); … … 356 357 public function compareNotice() 357 358 { 358 if ($alternative = $this->getArg( self::ALTERNATIVE_NAME)) {359 if ($alternative = $this->getArg(Constants::ALTERNATIVE_NAME)) { 359 360 360 361 $remoteTab = get_transient(self::REMOTE_TAB_CONTENT); … … 369 370 ); 370 371 371 $content = $this->get SettingLinkElement($message, 'remote-tab');372 $content = $this->getHelper()->getSetting()->getLinkElement($message, 'remote-tab'); 372 373 373 374 $HTMLHelper->renderNotice($content, [ … … 375 376 'prefix' => false, 376 377 'dismiss' => false, 377 self::TYPE => 'info',378 self::CUSTOM => true,378 Constants::TYPE => 'info', 379 Constants::CUSTOM => true, 379 380 ]); 380 381 } … … 388 389 $this->getHelper()->getHTML()->renderElement('a', [ 389 390 'href' => $this->getHelper()->getServer()->getAdminURL([ 390 self::TAB => self::GENERAL,391 self::PAGE => $this->getMenuSlug(),392 self::CONTEXT => self::INSTALL,391 Constants::TAB => Constants::GENERAL, 392 Constants::PAGE => $this->getMenuSlug(), 393 Constants::CONTEXT => Constants::INSTALL, 393 394 ]), 394 395 'class' => 'page-title-action', -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Component/Common.php
r3145930 r3154429 4 4 5 5 use Pmpr\Plugin\Pmpr\Component\ListTable\Common\Installed; 6 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 6 7 7 8 /** … … 17 18 { 18 19 $this->args = [ 19 self::TYPE => self::CMN,20 self::NAME => self::COMMON,21 self::POSITION => 0,20 Constants::TYPE => Constants::CMN, 21 Constants::NAME => Constants::COMMON, 22 Constants::POSITION => 0, 22 23 ]; 23 24 … … 29 30 parent::setTranslations(); 30 31 31 $this->addArg( self::PLURAL_NAME, __('Commons', PR__PLG__PMPR))32 ->addArg( self::SINGULAR_NAME, __('Common', PR__PLG__PMPR));32 $this->addArg(Constants::PLURAL_NAME, __('Commons', PR__PLG__PMPR)) 33 ->addArg(Constants::SINGULAR_NAME, __('Common', PR__PLG__PMPR)); 33 34 } 34 35 … … 66 67 }); 67 68 } 68 } else if ($this-> isRequirementsSatisfied()69 } else if ($this->getHelper()->getComponent()->isRequirementsSatisfied() 69 70 && !$this->getHelper()->getComponent()->isRequiredInstalled()) { 70 71 … … 75 76 public function installRequiredComponents() 76 77 { 77 if ($this-> isRequirementsSatisfied()) {78 if ($this->getHelper()->getComponent()->isRequirementsSatisfied()) { 78 79 79 80 $componentHelper = $this->getHelper()->getComponent(); -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Component/Component.php
r3140999 r3154429 4 4 5 5 use Pmpr\Plugin\Pmpr\Component\Manager\Initiator; 6 use Pmpr\Plugin\Pmpr\Component\Manager\Installer;7 6 use Pmpr\Plugin\Pmpr\Component\Manager\Preparation; 8 7 use Pmpr\Plugin\Pmpr\Container\Container; … … 33 32 public function loadRequirement() 34 33 { 34 Initiator::getInstance(); 35 35 if (is_admin()) { 36 36 37 Ajax::getInstance(); 38 Cover::getInstance(); 39 Custom::getInstance(); 40 Module::getInstance(); 41 Common::getInstance(); 37 if ($this->getHelper()->getTool()->isAjax()) { 38 Ajax::getInstance(); 39 } else { 40 41 Cover::getInstance(); 42 Custom::getInstance(); 43 Module::getInstance(); 44 Common::getInstance(); 45 Update::getInstance(); 46 Preparation::getInstance(); 47 } 42 48 } 43 44 Update::getInstance();45 Preparation::getInstance();46 Initiator::getInstance();47 49 } 48 50 -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Component/Cover.php
r2781204 r3154429 5 5 use Pmpr\Plugin\Pmpr\Component\ListTable\Cover\Install; 6 6 use Pmpr\Plugin\Pmpr\Component\ListTable\Cover\Installed; 7 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 7 8 8 9 /** … … 18 19 { 19 20 $this->args = [ 20 self::TYPE => self::CVR,21 self::NAME => self::COVER,22 self::POSITION => 5,21 Constants::TYPE => Constants::CVR, 22 Constants::NAME => Constants::COVER, 23 Constants::POSITION => 5, 23 24 ]; 24 25 … … 29 30 { 30 31 parent::setTranslations(); 31 $this->addArg( self::PLURAL_NAME, __('Covers', PR__PLG__PMPR))32 ->addArg( self::SINGULAR_NAME, __('Cover', PR__PLG__PMPR))33 ->addArg( self::ALTERNATIVE_NAME, __('Theme', PR__PLG__PMPR))34 ->addArg( self::NOT_FOUND, sprintf(__('Wordpress %s will be available here to get installed, very soon.', PR__PLG__PMPR), __('Covers', PR__PLG__PMPR)));32 $this->addArg(Constants::PLURAL_NAME, __('Covers', PR__PLG__PMPR)) 33 ->addArg(Constants::SINGULAR_NAME, __('Cover', PR__PLG__PMPR)) 34 ->addArg(Constants::ALTERNATIVE_NAME, __('Theme', PR__PLG__PMPR)) 35 ->addArg(Constants::NOT_FOUND, sprintf(__('Wordpress %s will be available here to get installed, very soon.', PR__PLG__PMPR), __('Covers', PR__PLG__PMPR))); 35 36 } 36 37 -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Component/Custom.php
r2781204 r3154429 5 5 use Pmpr\Plugin\Pmpr\Component\ListTable\Custom\Install; 6 6 use Pmpr\Plugin\Pmpr\Component\ListTable\Custom\Installed; 7 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 7 8 8 9 /** … … 18 19 { 19 20 $this->args = [ 20 self::TYPE => self::CST,21 self::NAME => self::CUSTOM,22 self::POSITION => 6,21 Constants::TYPE => Constants::CST, 22 Constants::NAME => Constants::CUSTOM, 23 Constants::POSITION => 6, 23 24 ]; 24 25 … … 30 31 parent::setTranslations(); 31 32 32 $this->addArg( self::PLURAL_NAME, __('Customs', PR__PLG__PMPR))33 ->addArg( self::SINGULAR_NAME, __('Custom', PR__PLG__PMPR))34 ->addArg( self::NOT_FOUND, sprintf(__('no %s founded for your domain.', PR__PLG__PMPR), __('Custom', PR__PLG__PMPR)));33 $this->addArg(Constants::PLURAL_NAME, __('Customs', PR__PLG__PMPR)) 34 ->addArg(Constants::SINGULAR_NAME, __('Custom', PR__PLG__PMPR)) 35 ->addArg(Constants::NOT_FOUND, sprintf(__('no %s founded for your domain.', PR__PLG__PMPR), __('Custom', PR__PLG__PMPR))); 35 36 } 36 37 -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Component/Item.php
r3152426 r3154429 3 3 namespace Pmpr\Plugin\Pmpr\Component; 4 4 5 use Pmpr\Plugin\Pmpr\Interfaces\Constant Interface;5 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 6 6 use Pmpr\Plugin\Pmpr\Traits\HelperTrait; 7 7 … … 10 10 * @package Pmpr\Plugin\Pmpr\Component 11 11 */ 12 class Item implements ConstantInterface12 class Item 13 13 { 14 14 use HelperTrait; … … 133 133 } 134 134 135 $component[ self::TITLE] = $title;136 $component[ self::DESCRIPTION] = $description;135 $component[Constants::TITLE] = $title; 136 $component[Constants::DESCRIPTION] = $description; 137 137 138 138 $this->data = $component; … … 356 356 public function isRequired(): bool 357 357 { 358 358 return false; 359 359 } 360 360 … … 381 381 { 382 382 $name = $this->getName(); 383 if (in_array($this->getType(), [ self::COMMON, self::UTILITY], true)) {383 if (in_array($this->getType(), [Constants::COMMON, Constants::UTILITY], true)) { 384 384 385 385 $isActive = $this->getHelper()->getComponent()->isInstalled($name); … … 484 484 485 485 $actions[] = $this->createAction([ 486 self::TITLE => __('Coming Soon', PR__PLG__PMPR),487 self::ENABLE => false,486 Constants::TITLE => __('Coming Soon', PR__PLG__PMPR), 487 Constants::ENABLE => false, 488 488 ]); 489 489 } else if ($backlinkModal = $this->getBacklinkModal()) { … … 492 492 493 493 $actions[] = $HTMLHelper->createModal([ 494 self::NAME => 'install-component',495 self::TITLE => $typeHelper->arrayGetItem($backlinkModal, self::TITLE),496 self::PREFIX => $this->getName() . '_modal',497 self::CONTENT => wpautop($typeHelper->arrayGetItem($backlinkModal, self::TEXT)),498 self::BUTTONS => [499 self::CANCEL,500 self::INSTALL => $this->createAction([501 self::JOB => self::INSTALL,502 self::TITLE => __('Accept & Install', PR__PLG__PMPR),503 self::ATTRS => [494 Constants::NAME => 'install-component', 495 Constants::TITLE => $typeHelper->arrayGetItem($backlinkModal, Constants::TITLE), 496 Constants::PREFIX => $this->getName() . '_modal', 497 Constants::CONTENT => wpautop($typeHelper->arrayGetItem($backlinkModal, Constants::TEXT)), 498 Constants::BUTTONS => [ 499 Constants::CANCEL, 500 Constants::INSTALL => $this->createAction([ 501 Constants::JOB => Constants::INSTALL, 502 Constants::TITLE => __('Accept & Install', PR__PLG__PMPR), 503 Constants::ATTRS => [ 504 504 'rol' => 'button', 505 505 'type' => 'button', … … 513 513 514 514 $actions[] = $this->createAction([ 515 self::JOB => self::INSTALL,516 self::TITLE => __('Install Now', PR__PLG__PMPR),515 Constants::JOB => Constants::INSTALL, 516 Constants::TITLE => __('Install Now', PR__PLG__PMPR), 517 517 ]); 518 518 } … … 520 520 521 521 $actions[] = $this->createAction([ 522 self::JOB => 'update',523 self::TITLE => __('Update', PR__PLG__PMPR),522 Constants::JOB => 'update', 523 Constants::TITLE => __('Update', PR__PLG__PMPR), 524 524 ]); 525 525 … … 527 527 528 528 $actions[] = $this->createAction([ 529 self::TITLE => __('Active', PR__PLG__PMPR),530 self::ENABLE => false,529 Constants::TITLE => __('Active', PR__PLG__PMPR), 530 Constants::ENABLE => false, 531 531 ]); 532 532 } else { 533 533 534 534 $actions[] = $this->createAction([ 535 self::JOB => 'activate',536 self::COLOR => self::PRIMARY,537 self::TITLE => __('Activation', PR__PLG__PMPR),535 Constants::JOB => 'activate', 536 Constants::COLOR => Constants::PRIMARY, 537 Constants::TITLE => __('Activation', PR__PLG__PMPR), 538 538 ]); 539 539 } … … 569 569 $typeHelper = $this->getHelper()->getType(); 570 570 571 $job = $typeHelper->arrayGetItem($args, self::JOB);572 $title = $typeHelper->arrayGetItem($args, self::TITLE);573 $enable = $typeHelper->arrayGetItem($args, 'enable', true);574 575 $color = $args[ self::COLOR] ?? 'default';571 $job = $typeHelper->arrayGetItem($args, Constants::JOB); 572 $title = $typeHelper->arrayGetItem($args, Constants::TITLE); 573 $enable = $typeHelper->arrayGetItem($args, Constants::ENABLE, true); 574 575 $color = $args[Constants::COLOR] ?? 'default'; 576 576 577 577 $args = $typeHelper->parseArgs($args, [ 578 self::JOB => $job,579 self::NAME => $this->getName(),580 self::SLUG => $this->getSlug(),581 self::TYPE => $this->getType(),582 self::COLOR => 'default',583 self::TITLE => $title,584 self::ATTRS => [578 Constants::JOB => $job, 579 Constants::NAME => $this->getName(), 580 Constants::SLUG => $this->getSlug(), 581 Constants::TYPE => $this->getType(), 582 Constants::COLOR => 'default', 583 Constants::TITLE => $title, 584 Constants::ATTRS => [ 585 585 'rol' => 'button', 586 586 'type' => 'button', -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Component/ListTable/Cover/Install.php
r2707477 r3154429 4 4 5 5 use Pmpr\Plugin\Pmpr\Component\ListTable\Install as BaseClass; 6 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 6 7 7 8 /** … … 17 18 public function getTabs($tabs) 18 19 { 19 $tabs[ self::DEDICATED] = __('Dedicated', PR__PLG__PMPR);20 $tabs[Constants::DEDICATED] = __('Dedicated', PR__PLG__PMPR); 20 21 21 22 return $tabs; -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Component/ListTable/Install.php
r3078042 r3154429 3 3 namespace Pmpr\Plugin\Pmpr\Component\ListTable; 4 4 5 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 5 6 use WP_Error; 6 7 … … 60 61 public function getName(): ?string 61 62 { 62 return $this->getArg( self::NAME);63 return $this->getArg(Constants::NAME); 63 64 } 64 65 … … 68 69 global $tabs, $tab, $paged, $s; 69 70 70 wp_reset_vars([ self::TAB]);71 wp_reset_vars([Constants::TAB]); 71 72 72 73 $perPage = 36; … … 75 76 $tabs = $this->applyFilters("install_{$name}_tabs", $tabs); 76 77 77 if ( self::SEARCH === $tab) {78 79 $tabs[ self::SEARCH] = __('Search Results', PR__PLG__PMPR);80 $args[ self::SEARCH] = $s;81 } 82 83 $tabs[ self::GENERAL] = __('General', PR__PLG__PMPR);78 if (Constants::SEARCH === $tab) { 79 80 $tabs[Constants::SEARCH] = __('Search Results', PR__PLG__PMPR); 81 $args[Constants::SEARCH] = $s; 82 } 83 84 $tabs[Constants::GENERAL] = __('General', PR__PLG__PMPR); 84 85 85 86 $tabs = $this->getTabs($tabs); 86 87 87 $componentHelper = $this->getHelper()->getComponent();88 $componentHelper = $this->getHelper()->getComponent(); 88 89 89 90 if ($componentHelper->isRequiredInstalled()) { 90 91 91 92 $args = [ 92 self::PAGE => $paged,93 self::TYPE => $name,94 self::LOCALE => get_user_locale(),95 self::PER_PAGE => $perPage,96 self::DEDICATED => isset($tabs[self::DEDICATED]) && self::DEDICATED === $tab,93 Constants::PAGE => $paged, 94 Constants::TYPE => $name, 95 Constants::LOCALE => get_user_locale(), 96 Constants::PER_PAGE => $perPage, 97 Constants::DEDICATED => isset($tabs[Constants::DEDICATED]) && Constants::DEDICATED === $tab, 97 98 ]; 98 99 … … 110 111 $this->set_pagination_args( 111 112 [ 112 'total_items' => $result->pagination->total,113 self::PER_PAGE => $perPage,113 'total_items' => $result->pagination->total, 114 Constants::PER_PAGE => $perPage, 114 115 ] 115 116 ); … … 139 140 $attrs = [ 140 141 'class' => 'current', 141 'aria-current' => self::PAGE,142 'aria-current' => Constants::PAGE, 142 143 ]; 143 144 } 144 145 $attrs['href'] = $serverHelper->getAdminURL([ 145 self::TAB => $action,146 self::PAGE => $this->getArg(self::MENU_SLUG),147 self::CONTEXT => self::INSTALL,146 Constants::TAB => $action, 147 Constants::PAGE => $this->getArg(Constants::MENU_SLUG), 148 Constants::CONTEXT => Constants::INSTALL, 148 149 ]); 149 150 … … 173 174 global $tab; 174 175 175 $plural = $this->getArg( self::PLURAL_NAME);176 $plural = $this->getArg(Constants::PLURAL_NAME); 176 177 $search = ''; 177 178 $HTMLHelper = $this->getHelper()->getHTML(); 178 if ( self::DEDICATED !== $tab) {179 if (Constants::DEDICATED !== $tab) { 179 180 180 181 $search = $HTMLHelper->renderTemplate('install/search', [ 181 182 'args' => [ 182 self::TAB => self::SEARCH,183 self::PAGE => $this->getArg(self::MENU_SLUG),184 self::CONTEXT => self::INSTALL,183 Constants::TAB => Constants::SEARCH, 184 Constants::PAGE => $this->getArg(Constants::MENU_SLUG), 185 Constants::CONTEXT => Constants::INSTALL, 185 186 ], 186 187 'search_label' => sprintf($this->getArg('search_label'), $plural), … … 199 200 global $tab; 200 201 201 $singular = $this->getArg( self::SINGULAR_NAME);202 if ( self::DEDICATED === $tab) {202 $singular = $this->getArg(Constants::SINGULAR_NAME); 203 if (Constants::DEDICATED === $tab) { 203 204 204 205 $message = sprintf(__('No exclusive %s found for your domain.', PR__PLG__PMPR), $singular); 205 206 } else { 206 207 207 $message = $this->getArg( self::NOT_FOUND);208 $message = $this->getArg(Constants::NOT_FOUND); 208 209 if (!$message) { 209 210 210 if ( self::SEARCH === $tab) {211 if (Constants::SEARCH === $tab) { 211 212 212 213 $message = sprintf(__('No %s found. Try a different search.', PR__PLG__PMPR), $singular); … … 219 220 220 221 $this->getHelper()->getHTML()->renderTemplate('install/not-found', [ 221 'error'=> $this->getError(),222 self::NOT_FOUND => $message,222 Constants::ERROR => $this->getError(), 223 Constants::NOT_FOUND => $message, 223 224 ]); 224 225 } -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Component/ListTable/Installed.php
r3152426 r3154429 4 4 5 5 use Pmpr\Plugin\Pmpr\Component\Item; 6 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 6 7 7 8 /** … … 25 26 global $status; 26 27 27 $status = $this->getHelper()->getServer()->getRequest( self::STATUS, self::ALL);28 $status = $this->getHelper()->getServer()->getRequest(Constants::STATUS, Constants::ALL); 28 29 29 30 $statuses = ['active', 'inactive', 'search', 'paused']; … … 48 49 49 50 $columns = array_merge($columns, [ 50 self::TITLE => $this->getArg(self::SINGULAR_NAME),51 self::DESCRIPTION => __('Description', PR__PLG__PMPR),51 Constants::TITLE => $this->getArg(Constants::SINGULAR_NAME), 52 Constants::DESCRIPTION => __('Description', PR__PLG__PMPR), 52 53 ]); 53 54 54 if ($this->getArg( self::AUTO_UPDATE)) {55 if ($this->getArg(Constants::AUTO_UPDATE)) { 55 56 56 57 $columns['auto-updates'] = __('Automatic Updates', PR__PLG__PMPR); … … 95 96 96 97 $args = [ 97 self::PAGE => $this->getArg(self::MENU_SLUG),98 self::STATUS => $type,98 Constants::PAGE => $this->getArg(Constants::MENU_SLUG), 99 Constants::STATUS => $type, 99 100 ]; 100 101 … … 139 140 'href' => $this->getHelper()->getServer()->getAdminURL([ 140 141 's' => urlencode($s), 141 self::TAB => self::SEARCH,142 self::PAGE => $this->getArg(self::MENU_SLUG),143 self::CONTEXT => self::INSTALL,142 Constants::TAB => Constants::SEARCH, 143 Constants::PAGE => $this->getArg(Constants::MENU_SLUG), 144 Constants::CONTEXT => Constants::INSTALL, 144 145 ]), 145 ], sprintf(__('Search for %s in the Pmpr Modules Directory.', PR__PLG__PMPR), $this->getArg( self::PLURAL_NAME)));146 ], sprintf(__('Search for %s in the Pmpr Modules Directory.', PR__PLG__PMPR), $this->getArg(Constants::PLURAL_NAME))); 146 147 } 147 148 … … 173 174 174 175 $components = [ 175 self::ALL => $allComponents,176 self::SEARCH => [],177 self::ACTIVE => [],178 self::INACTIVE => [],176 Constants::ALL => $allComponents, 177 Constants::SEARCH => [], 178 Constants::ACTIVE => [], 179 Constants::INACTIVE => [], 179 180 ]; 180 181 … … 183 184 if ($s) { 184 185 185 $status = self::SEARCH;186 $components[ self::SEARCH] = array_filter($components[self::ALL], [$this, '_search_callback']);186 $status = Constants::SEARCH; 187 $components[Constants::SEARCH] = array_filter($components[Constants::ALL], [$this, '_search_callback']); 187 188 } 188 189 189 190 $typeHelper = $this->getHelper()->getType(); 190 foreach ($components[ self::ALL] as $data) {191 192 $componentStatus = $typeHelper->arrayGetItem($data, self::STATUS);191 foreach ($components[Constants::ALL] as $data) { 192 193 $componentStatus = $typeHelper->arrayGetItem($data, Constants::STATUS); 193 194 if (isset($components[$componentStatus])) { 194 195 … … 204 205 205 206 if (empty($components[$status]) 206 && !in_array($status, [ self::ALL, self::SEARCH], true)) {207 208 $status = self::ALL;207 && !in_array($status, [Constants::ALL, Constants::SEARCH], true)) { 208 209 $status = Constants::ALL; 209 210 } 210 211 … … 213 214 if (!$orderby) { 214 215 215 $orderby = self::NAME;216 $orderby = Constants::NAME; 216 217 } else { 217 218 … … 235 236 [ 236 237 'total_items' => $total, 237 self::PER_PAGE => $perPage,238 Constants::PER_PAGE => $perPage, 238 239 ] 239 240 ); … … 431 432 'orderby' => sanitize_text_field($serverHelper->getRequest('orderby') ?? ''), 432 433 'order' => sanitize_text_field($serverHelper->getRequest('order') ?? ''), 433 self::PAGE => $this->getArg(self::MENU_SLUG),434 Constants::PAGE => $this->getArg(Constants::MENU_SLUG), 434 435 ], 435 436 'text' => $text, 436 self::TYPE => $this->getArg(self::NAME),437 self::NAME => $this->getArg(self::SINGULAR_NAME),437 Constants::TYPE => $this->getArg(Constants::NAME), 438 Constants::NAME => $this->getArg(Constants::SINGULAR_NAME), 438 439 'input_id' => $input_id . '-search-input', 439 440 ]); … … 443 444 protected function get_primary_column_name() 444 445 { 445 return self::TITLE;446 return Constants::TITLE; 446 447 } 447 448 … … 534 535 'class' => 'pr-installed-action' . ((!isset($args['reload']) || $args['reload']) ? ' pr-component-reload' : ''), 535 536 ], 536 self::JOB => $job,537 self::NAME => $item->getName(),538 self::TYPE => $item->getType(),539 self::SLUG => $item->getSlug(),540 self::TITLE => $title,541 self::ELEMENT => 'a',537 Constants::JOB => $job, 538 Constants::NAME => $item->getName(), 539 Constants::TYPE => $item->getType(), 540 Constants::SLUG => $item->getSlug(), 541 Constants::TITLE => $title, 542 Constants::ELEMENT => 'a', 542 543 ]); 543 544 -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Component/ListTable/ListTable.php
r3140039 r3154429 3 3 namespace Pmpr\Plugin\Pmpr\Component\ListTable; 4 4 5 use Pmpr\Plugin\Pmpr\Interfaces\Constant Interface;5 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 6 6 use Pmpr\Plugin\Pmpr\Traits\APITrait; 7 use Pmpr\Plugin\Pmpr\Traits\CommonTrait;8 7 use Pmpr\Plugin\Pmpr\Traits\HelperTrait; 9 8 use Pmpr\Plugin\Pmpr\Traits\HookTrait; 10 9 use Pmpr\Plugin\Pmpr\Traits\ManagerTrait; 11 use Pmpr\Plugin\Pmpr\Traits\SettingTrait;12 10 use WP_List_Table; 13 11 … … 16 14 * @package Pmpr\Plugin\Pmpr\Component 17 15 */ 18 abstract class ListTable extends WP_List_Table implements ConstantInterface16 abstract class ListTable extends WP_List_Table 19 17 { 20 18 use APITrait, 21 19 HookTrait, 22 20 HelperTrait, 23 CommonTrait, 24 ManagerTrait, 25 SettingTrait; 21 ManagerTrait; 26 22 27 23 /** … … 32 28 public function __construct($args = []) 33 29 { 34 $args['screen'] = "{$this->getArg( self::MENU_SLUG)}-{$this->getArg(self::NAME)}";30 $args['screen'] = "{$this->getArg(Constants::MENU_SLUG)}-{$this->getArg(Constants::NAME)}"; 35 31 36 32 global $page, $s; … … 51 47 public function getType(): string 52 48 { 53 return (string)$this->getArg( self::TYPE, '');49 return (string)$this->getArg(Constants::TYPE, ''); 54 50 } 55 51 -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Component/ListTable/Module/Install.php
r2707477 r3154429 4 4 5 5 use Pmpr\Plugin\Pmpr\Component\ListTable\Install as BaseClass; 6 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 6 7 7 8 /** … … 17 18 public function getTabs($tabs) 18 19 { 19 $tabs[ self::DEDICATED] = __('Dedicated', PR__PLG__PMPR);20 $tabs[Constants::DEDICATED] = __('Dedicated', PR__PLG__PMPR); 20 21 21 22 return $tabs; -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Component/ListTable/Update/Installed.php
r3152426 r3154429 5 5 use Pmpr\Plugin\Pmpr\Component\Item; 6 6 use Pmpr\Plugin\Pmpr\Component\ListTable\ListTable; 7 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 7 8 8 9 /** … … 19 20 { 20 21 return [ 21 self::TITLE => __('Component', PR__PLG__PMPR),22 self::VERSION => __('Current Version', PR__PLG__PMPR),23 self::NEW_VERSION => __('New Version', PR__PLG__PMPR),22 Constants::TITLE => __('Component', PR__PLG__PMPR), 23 Constants::VERSION => __('Current Version', PR__PLG__PMPR), 24 Constants::NEW_VERSION => __('New Version', PR__PLG__PMPR), 24 25 ]; 25 26 } -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Component/Manager/Initiator.php
r3152426 r3154429 4 4 5 5 use Exception; 6 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 6 7 use Pmpr\Plugin\Pmpr\Traits\ManagerTrait; 7 8 … … 21 22 return; 22 23 } 23 $this->loadComponents();24 // $this->loadComponents(); 24 25 } 25 26 … … 57 58 public function loadCommons(): bool 58 59 { 59 $commons = $this->getHelper()->getComponent()->getInstalledByType( self::COMMON);60 $commons = $this->getHelper()->getComponent()->getInstalledByType(Constants::COMMON); 60 61 foreach ($commons as $component) { 61 62 … … 72 73 { 73 74 $types = [ 74 self::MODULE,75 self::CUSTOM,75 Constants::MODULE, 76 Constants::CUSTOM, 76 77 ]; 77 78 -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Component/Module.php
r2706126 r3154429 5 5 use Pmpr\Plugin\Pmpr\Component\ListTable\Module\Install; 6 6 use Pmpr\Plugin\Pmpr\Component\ListTable\Module\Installed; 7 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 7 8 8 9 /** … … 18 19 { 19 20 $this->args = [ 20 self::TYPE => self::MDL,21 self::NAME => self::MODULE,22 self::POSITION => 0,21 Constants::TYPE => Constants::MDL, 22 Constants::NAME => Constants::MODULE, 23 Constants::POSITION => 0, 23 24 ]; 24 25 … … 29 30 { 30 31 parent::setTranslations(); 31 $this->addArg( self::PLURAL_NAME, __('Modules', PR__PLG__PMPR))32 ->addArg( self::SINGULAR_NAME, __('Module', PR__PLG__PMPR))33 ->addArg( self::ALTERNATIVE_NAME, __('Plugin', PR__PLG__PMPR));32 $this->addArg(Constants::PLURAL_NAME, __('Modules', PR__PLG__PMPR)) 33 ->addArg(Constants::SINGULAR_NAME, __('Module', PR__PLG__PMPR)) 34 ->addArg(Constants::ALTERNATIVE_NAME, __('Plugin', PR__PLG__PMPR)); 34 35 } 35 36 -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Component/Process.php
r3142498 r3154429 3 3 namespace Pmpr\Plugin\Pmpr\Component; 4 4 5 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 5 6 use Pmpr\Plugin\Pmpr\Queue; 6 7 … … 11 12 class Process extends Queue 12 13 { 13 const MIDNIGHT_UPDATE_JOB = self::PLUGIN_PREFIX . '_midnight_update';14 const INSTALL_REQUIRED_COMMONS = self::PLUGIN_PREFIX . '_install_required_commons';15 const CHECK_COMPONENTS_UPDATE_JOB = self::PLUGIN_PREFIX . '_check_components_update';14 const MIDNIGHT_UPDATE_JOB = Constants::PLUGIN_PREFIX . '_midnight_update'; 15 const INSTALL_REQUIRED_COMMONS = Constants::PLUGIN_PREFIX . '_install_required_commons'; 16 const CHECK_COMPONENTS_UPDATE_JOB = Constants::PLUGIN_PREFIX . '_check_components_update'; 16 17 17 18 public function __construct() … … 68 69 { 69 70 return $this->exists([ 70 self::HOOK => self::MIDNIGHT_UPDATE_JOB,71 self::STATUS => [self::PENDING, self::IN_PROGRESS],71 Constants::HOOK => self::MIDNIGHT_UPDATE_JOB, 72 Constants::STATUS => [Constants::PENDING, Constants::IN_PROGRESS], 72 73 ]); 73 74 } … … 79 80 { 80 81 return $this->exists([ 81 self::HOOK => self::INSTALL_REQUIRED_COMMONS,82 self::STATUS => [self::PENDING, self::IN_PROGRESS],82 Constants::HOOK => self::INSTALL_REQUIRED_COMMONS, 83 Constants::STATUS => [Constants::PENDING, Constants::IN_PROGRESS], 83 84 ]); 84 85 } -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Component/Update.php
r3078046 r3154429 4 4 5 5 use Pmpr\Plugin\Pmpr\Component\ListTable\Update\Installed; 6 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 6 7 7 8 /** … … 17 18 { 18 19 $this->args = [ 19 self::NAME => 'update',20 self::POSITION => 10,20 Constants::NAME => 'update', 21 Constants::POSITION => 10, 21 22 ]; 22 23 … … 28 29 parent::setTranslations(); 29 30 30 $this->addArg( self::PLURAL_NAME, __('Update', PR__PLG__PMPR))31 ->addArg( self::SINGULAR_NAME, __('Update', PR__PLG__PMPR));31 $this->addArg(Constants::PLURAL_NAME, __('Update', PR__PLG__PMPR)) 32 ->addArg(Constants::SINGULAR_NAME, __('Update', PR__PLG__PMPR)); 32 33 } 33 34 … … 39 40 40 41 parent::addActions(); 41 }42 43 public function addFilters()44 {45 if (!$this->isPrivate()) {46 47 $this->addFilter('pmpr_components_update_count', [$this, 'getUpdateCount']);48 }49 42 } 50 43 … … 95 88 96 89 $types = [ 97 self::COMMON => [98 self::TITLE => __('Commons', PR__PLG__PMPR),99 self::COUNT => 0,90 Constants::COMMON => [ 91 Constants::TITLE => __('Commons', PR__PLG__PMPR), 92 Constants::COUNT => 0, 100 93 ], 101 self::MODULE => [102 self::TITLE => __('Modules', PR__PLG__PMPR),103 self::COUNT => 0,94 Constants::MODULE => [ 95 Constants::TITLE => __('Modules', PR__PLG__PMPR), 96 Constants::COUNT => 0, 104 97 ], 105 self::COVER => [106 self::TITLE => __('Covers', PR__PLG__PMPR),107 self::COUNT => 0,98 Constants::COVER => [ 99 Constants::TITLE => __('Covers', PR__PLG__PMPR), 100 Constants::COUNT => 0, 108 101 ], 109 self::CUSTOM => [110 self::TITLE => __('Customs', PR__PLG__PMPR),111 self::COUNT => 0,102 Constants::CUSTOM => [ 103 Constants::TITLE => __('Customs', PR__PLG__PMPR), 104 Constants::COUNT => 0, 112 105 ], 113 106 ]; … … 124 117 125 118 $hasUpdate = true; 126 $types[$type][ self::COUNT]++;127 $types[$type][ self::UPDATE][$componentName] = $component;119 $types[$type][Constants::COUNT]++; 120 $types[$type][Constants::UPDATE][$componentName] = $component; 128 121 } 129 122 } -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Container/Container.php
r3078042 r3154429 4 4 5 5 use Pmpr\Plugin\Pmpr\Container\Traits\SingletonTrait; 6 use Pmpr\Plugin\Pmpr\Interfaces\Constant Interface;6 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 7 7 use Pmpr\Plugin\Pmpr\Traits\APITrait; 8 use Pmpr\Plugin\Pmpr\Traits\CommonTrait;9 8 use Pmpr\Plugin\Pmpr\Traits\HelperTrait; 10 9 use Pmpr\Plugin\Pmpr\Traits\HookTrait; 11 use Pmpr\Plugin\Pmpr\Traits\SettingTrait;12 10 13 11 /** … … 15 13 * @package Pmpr\Plugin\Pmpr\Container 16 14 */ 17 class Container implements ConstantInterface15 class Container 18 16 { 19 const REMOTE_TAB_CONTENT = self::PLUGIN_PREFIX . 'remote_tab_content_transient';17 const REMOTE_TAB_CONTENT = Constants::PLUGIN_PREFIX . 'remote_tab_content_transient'; 20 18 21 19 use APITrait, 22 20 HookTrait, 23 CommonTrait,24 21 HelperTrait, 25 SettingTrait,26 22 SingletonTrait; 27 23 … … 56 52 $result = null; 57 53 switch ($target) { 58 case self::COMMONS_INSTALLATION_PROBLEM:54 case Constants::COMMONS_INSTALLATION_PROBLEM: 59 55 $result = __('There is a problem in commons installation. Please refresh the page to try again. Contact us, if the problem remain.', PR__PLG__PMPR); 60 56 break; -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Container/Storage.php
r3078042 r3154429 4 4 5 5 use Exception; 6 use Pmpr\Plugin\Pmpr\Interfaces\ConstantInterface;7 6 8 7 /** … … 10 9 * @package Pmpr\Plugin\Pmpr\Container 11 10 */ 12 class Storage implements ConstantInterface11 class Storage 13 12 { 14 13 /** -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Helper/Common.php
r3078046 r3154429 4 4 5 5 use Pmpr\Plugin\Pmpr\Container\Traits\SingletonTrait; 6 use Pmpr\Plugin\Pmpr\Interfaces\ConstantInterface;7 6 use Pmpr\Plugin\Pmpr\Traits\HelperTrait; 8 7 … … 11 10 * @package Pmpr\Plugin\Pmpr\Helper 12 11 */ 13 abstract class Common implements ConstantInterface12 abstract class Common 14 13 { 15 14 use SingletonTrait, -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Helper/Component.php
r3152426 r3154429 6 6 use Pmpr\Plugin\Pmpr\API; 7 7 use Pmpr\Plugin\Pmpr\Component\Item; 8 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 8 9 9 10 /** … … 143 144 $typeHelper = $this->getHelper()->getType(); 144 145 145 $name = $typeHelper->arrayGetItem($fetched, self::NAME);146 $name = $typeHelper->arrayGetItem($fetched, Constants::NAME); 146 147 if ($name && ($component = $this->getData($name))) { 147 148 … … 205 206 $data = $this->getData($component); 206 207 $changed = false; 207 if ($data && isset($data[ self::STATUS])208 && $data[ self::STATUS] !== $status) {209 210 $data[ self::STATUS] = $status;208 if ($data && isset($data[Constants::STATUS]) 209 && $data[Constants::STATUS] !== $status) { 210 211 $data[Constants::STATUS] = $status; 211 212 $this->updateData($component, $data); 212 213 $changed = true; … … 223 224 public function active($component): bool 224 225 { 225 return $this->changeStatus($component, self::ACTIVE);226 return $this->changeStatus($component, Constants::ACTIVE); 226 227 } 227 228 … … 233 234 public function deactivate($component): bool 234 235 { 235 return $this->changeStatus($component, self::INACTIVE);236 return $this->changeStatus($component, Constants::INACTIVE); 236 237 } 237 238 … … 261 262 * @return false|mixed|Item|null 262 263 */ 263 public function getData(string $component, string $output = self::ARRAY)264 public function getData(string $component, string $output = Constants::ARRAY) 264 265 { 265 266 $return = get_option(self::COMPONENT_ . $component, []); 266 267 267 if (is_array($return) && empty($return[ self::NAME])) {268 269 $return[ self::NAME] = $component;270 } 271 272 if ( self::OBJECT === $output) {268 if (is_array($return) && empty($return[Constants::NAME])) { 269 270 $return[Constants::NAME] = $component; 271 } 272 273 if (Constants::OBJECT === $output) { 273 274 274 275 $return = $this->getObject($return); … … 285 286 public function getDataAsObject(string $component) 286 287 { 287 return $this->getData($component, self::OBJECT);288 return $this->getData($component, Constants::OBJECT); 288 289 } 289 290 … … 321 322 { 322 323 $component = $this->getData($name); 323 return $this->isInstalled($name) && ($component[self::STATUS] ?? '') === self::ACTIVE; 324 return $this->isInstalled($name) 325 && ($component[Constants::STATUS] ?? '') === Constants::ACTIVE; 324 326 } 325 327 … … 332 334 { 333 335 $types = [ 334 self::COMMON => self::CMN,335 self::UTILITY => self::UTL,336 self::MODULE => self::MDL,337 self::COVER => self::CVR,338 self::CUSTOM => self::CST,336 Constants::COMMON => Constants::CMN, 337 Constants::UTILITY => Constants::UTL, 338 Constants::MODULE => Constants::MDL, 339 Constants::COVER => Constants::CVR, 340 Constants::CUSTOM => Constants::CST, 339 341 ]; 340 342 … … 419 421 public function clearCache() 420 422 { 421 delete_option( self::UPDATE_COUNT);423 delete_option(Constants::UPDATE_COUNT); 422 424 $this->getHelper()->getAsset()->clearBuildPath(); 423 425 } … … 428 430 public function getUpdateCount() 429 431 { 430 return get_option(self::UPDATE_COUNT); 432 return get_option(Constants::UPDATE_COUNT); 433 } 434 435 /** 436 * @param bool $checkAPI 437 * @return bool 438 */ 439 public function isRequirementsSatisfied(bool $checkAPI = true): bool 440 { 441 $satisfied = true; 442 $typeHelper = $this->getHelper()->getType(); 443 $requirements = $this->requirementsNotices(); 444 foreach ($requirements as $requirement) { 445 446 if ($typeHelper->arrayGetItem($requirement, 'show')) { 447 448 $satisfied = false; 449 break; 450 } 451 } 452 453 if ($satisfied && $checkAPI 454 && !$this->getHelper()->getSetting()->getAPIKey()) { 455 456 $satisfied = false; 457 } 458 459 return $satisfied; 460 } 461 462 /** 463 * @param bool $echo 464 * @param array $args 465 * @return array 466 */ 467 public function requirementsNotices(bool $echo = false, array $args = []): array 468 { 469 $base = $this->getHelper()->getFile()->getBaseDirPath(); 470 $settingHelper = $this->getHelper()->getSetting(); 471 472 $requirements['writable'] = [ 473 Constants::SHOW => !$base || !$this->getHelper()->getFile()->isWritable($base), 474 Constants::TEXT => __('Please contact us.', PR__PLG__PMPR), 475 Constants::TITLE => __('Components Installation Possibility', PR__PLG__PMPR), 476 Constants::DESCRIPTION => __('Access to domain root directory is required to complete the installation process.', PR__PLG__PMPR), 477 ]; 478 479 $requirements['api-key'] = [ 480 Constants::SHOW => !$settingHelper->getAPIKey() && !$settingHelper->isSettingPage(), 481 Constants::TEXT => sprintf( 482 '%s, %s.', 483 __('To complete the installation of PMPR plugin', PR__PLG__PMPR), 484 $settingHelper->getLinkElement(__('enter your api key in here', PR__PLG__PMPR)) 485 ), 486 Constants::TYPE => 'info', 487 Constants::TITLE => __('API Key', PR__PLG__PMPR), 488 Constants::DESCRIPTION => __('It\'s required to communicate with the server.', PR__PLG__PMPR), 489 ]; 490 491 foreach ($requirements as $index => $requirement) { 492 493 $text = $requirement[Constants::TEXT]; 494 $desc = $requirement[Constants::DESCRIPTION]; 495 $message = sprintf('%s %s', $text, $desc); 496 497 $args[Constants::TYPE] = $requirement[Constants::TYPE] ?? ($args[Constants::TYPE] ?? 'warning'); 498 499 if ($echo) { 500 501 if ($requirement['show']) { 502 503 $this->getHelper()->getHTML()->renderNotice($message, $args); 504 } else { 505 506 unset($requirements[$index]); 507 } 508 } else { 509 510 $requirements[$index][Constants::TEXT] = $this->getHelper()->getHTML()->createNotice($message, $args); 511 } 512 } 513 514 return $requirements; 515 } 516 517 /** 518 * @return string 519 */ 520 public function getCommonsNotice(): string 521 { 522 $link = $this->getHelper()->getHTML()->createElement('a', [ 523 'href' => apply_filters('pmpr_plugin_commons_url', ''), 524 ], __('here', PR__PLG__PMPR)); 525 526 return sprintf(__('Please install commons from %s.', PR__PLG__PMPR), $link); 431 527 } 432 528 } -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Helper/HTML.php
r3145930 r3154429 2 2 3 3 namespace Pmpr\Plugin\Pmpr\Helper; 4 5 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 4 6 5 7 /** … … 209 211 210 212 $allowAttrs = [ 211 self::ID => [],213 Constants::ID => [], 212 214 'data' => [], 213 215 'style' => [], … … 364 366 { 365 367 $args = $this->getHelper()->getType()->parseArgs($args, [ 366 self::JOB => '',367 self::TYPE => '',368 self::SLUG => '',369 self::NAME => '',370 self::ATTRS => [],371 self::TITLE => '',372 self::LOADING => false,373 self::ELEMENT => 'button',368 Constants::JOB => '', 369 Constants::TYPE => '', 370 Constants::SLUG => '', 371 Constants::NAME => '', 372 Constants::ATTRS => [], 373 Constants::TITLE => '', 374 Constants::LOADING => false, 375 Constants::ELEMENT => 'button', 374 376 ]); 375 377 376 378 $spinner = ''; 377 $context = $this->getHelper()->getServer()->getGet( self::CONTEXT, self::INSTALLED);379 $context = $this->getHelper()->getServer()->getGet(Constants::CONTEXT, Constants::INSTALLED); 378 380 $class = "pr-component-action pr-{$context}-action"; 379 381 380 if ($args[ self::LOADING]) {382 if ($args[Constants::LOADING]) { 381 383 382 384 $spinner = $this->createSpan('', [ … … 386 388 } 387 389 388 $attrs = $args[ self::ATTRS];390 $attrs = $args[Constants::ATTRS]; 389 391 if (isset($attrs['class'])) { 390 392 … … 396 398 397 399 $attrs = array_merge($attrs, [ 398 'data-job' => $args[ self::JOB],399 'data-type' => $args[ self::TYPE],400 'data-name' => $args[ self::NAME],401 'data-slug' => $args[ self::SLUG],400 'data-job' => $args[Constants::JOB], 401 'data-type' => $args[Constants::TYPE], 402 'data-name' => $args[Constants::NAME], 403 'data-slug' => $args[Constants::SLUG], 402 404 'data-nonce' => wp_create_nonce(PR__PLG__PMPR . '_nonce_action'), 403 405 ]); … … 405 407 $attrs = array_filter($attrs); 406 408 407 $content = $spinner . $this->createSpan($args[ self::TITLE], ['class' => 'action-title']);408 409 return $this->createElement($args[ self::ELEMENT], $attrs, $content);409 $content = $spinner . $this->createSpan($args[Constants::TITLE], ['class' => 'action-title']); 410 411 return $this->createElement($args[Constants::ELEMENT], $attrs, $content); 410 412 } 411 413 … … 420 422 $args = $this->getHelper()->getType()->parseArgs($args, [ 421 423 'class' => '', 422 self::ID => '',423 self::ECHO => false,424 self::TYPE => 'warning',425 self::PREFIX => __('Pmpr Plugin', PR__PLG__PMPR),426 self::CUSTOM => false,427 self::DISMISS => true,428 self::ELEMENT => 'p',424 Constants::ID => '', 425 Constants::ECHO => false, 426 Constants::TYPE => 'warning', 427 Constants::PREFIX => __('Pmpr Plugin', PR__PLG__PMPR), 428 Constants::CUSTOM => false, 429 Constants::DISMISS => true, 430 Constants::ELEMENT => 'p', 429 431 'element_attrs' => [], 430 432 ]); 431 433 432 $element = $args[ self::ELEMENT];434 $element = $args[Constants::ELEMENT]; 433 435 434 436 if (is_wp_error($message)) { … … 493 495 public function renderModal(array $args, string $title, array $attrs = []) 494 496 { 495 $args[ self::ECHO] = true;497 $args[Constants::ECHO] = true; 496 498 497 499 $this->createModal($args, $title, $attrs); -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Helper/Helper.php
r3078046 r3154429 4 4 5 5 use Exception; 6 use Pmpr\Plugin\Pmpr\Setting; 6 7 7 8 /** … … 67 68 68 69 /** 70 * @return Setting 71 */ 72 public function getSetting(): Setting 73 { 74 return Setting::getInstance(); 75 } 76 77 /** 78 * @return Tool 79 */ 80 public function getTool(): Tool 81 { 82 return $this->getInstance(Tool::class); 83 } 84 85 /** 69 86 * @return File 70 87 */ -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Helper/Server.php
r3140903 r3154429 2 2 3 3 namespace Pmpr\Plugin\Pmpr\Helper; 4 5 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 4 6 5 7 /** … … 190 192 public function isPluginPage(): bool 191 193 { 192 return str_contains($this->getGet('page', ''), self::PLUGIN_PREFIX); 194 return str_contains($this->getGet('page', ''), Constants::PLUGIN_PREFIX); 195 } 196 197 /** 198 * @param $data 199 * @param bool $success 200 * @param bool|string $notice 201 */ 202 public function ajaxResponse($data, bool $success = true, $notice = true) 203 { 204 if ($notice && is_string($data)) { 205 206 if (is_bool($notice)) { 207 208 $notice = $success ? 'success' : 'error'; 209 } 210 211 $data = $this->getHelper()->getHTML()->createNotice($data, [ 212 Constants::TYPE => $notice, 213 ]); 214 } 215 if ($success) { 216 217 wp_send_json_success($data); 218 } else { 219 220 wp_send_json_error($data); 221 } 193 222 } 194 223 } -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Manager.php
r3152426 r3154429 6 6 use Pmpr\Plugin\Pmpr\Component\Manager\Installer; 7 7 use Pmpr\Plugin\Pmpr\Container\Container; 8 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 8 9 use WP_Ajax_Upgrader_Skin; 9 10 use WP_Error; … … 73 74 public function install(string $component, array $args = []) 74 75 { 75 $this->updateOption($component, self::INACTIVE, true);76 $this->updateOption($component, Constants::INACTIVE, true); 76 77 77 78 $result = true; … … 112 113 public function remove(string $component) 113 114 { 114 $this->updateOption($component, self::INACTIVE, true);115 $this->updateOption($component, Constants::INACTIVE, true); 115 116 return $this->getInstaller()->remove($component); 116 117 } … … 121 122 public function activate(string $component) 122 123 { 123 $this->updateOption($component, self::ACTIVE);124 $this->updateOption($component, Constants::ACTIVE); 124 125 $this->afterChange($component); 125 126 } … … 130 131 public function deactivate(string $component) 131 132 { 132 $this->updateOption($component, self::INACTIVE);133 $this->updateOption($component, Constants::INACTIVE); 133 134 $this->afterChange($component); 134 135 } … … 184 185 185 186 $data = [ 186 self::NAME => $component,187 self::TITLE => $component,187 Constants::NAME => $component, 188 Constants::TITLE => $component, 188 189 ]; 189 190 } else { … … 195 196 196 197 $data = (array)$data; 197 $data[ self::STATUS] = $status;198 $data[Constants::STATUS] = $status; 198 199 $componentHelper->updateData($component, $data); 199 200 } … … 213 214 if (!is_wp_error($info) && !empty($info[$versionKey]) && $componentObject->hasUpdate($info[$versionKey])) { 214 215 215 $this->fetchAndStoreComponentData($component, [ self::NEW_VERSION => $info[$versionKey]]);216 $this->fetchAndStoreComponentData($component, [Constants::NEW_VERSION => $info[$versionKey]]); 216 217 } 217 218 } … … 222 223 public function storeUpdates() 223 224 { 224 update_option( self::UPDATE_COUNT, count($this->getHelper()->getComponent()->getNeedUpdates()));225 update_option(Constants::UPDATE_COUNT, count($this->getHelper()->getComponent()->getNeedUpdates())); 225 226 } 226 227 … … 230 231 public function fetchAndStoreAPIKey() 231 232 { 232 if (empty($this->get APIKey())) {233 if (empty($this->getHelper()->getSetting()->getAPIKey())) { 233 234 234 235 $authKey = ''; … … 262 263 if ($fs->put_contents(trailingslashit($rootPath) . $filename, $authKey)) { 263 264 264 update_option( self::CONNECTION_AUTH_KEY, $authKey);265 update_option(Constants::CONNECTION_AUTH_KEY, $authKey); 265 266 } 266 267 } else { … … 273 274 } 274 275 275 if (get_option( self::CONNECTION_AUTH_KEY, '') !== $authKey) {276 277 update_option( self::CONNECTION_AUTH_KEY, $authKey);276 if (get_option(Constants::CONNECTION_AUTH_KEY, '') !== $authKey) { 277 278 update_option(Constants::CONNECTION_AUTH_KEY, $authKey); 278 279 } 279 280 } … … 335 336 if ($componentData && !is_wp_error($fetchedData)) { 336 337 337 $extraData[ self::STATUS] = $this->getHelper()->getType()->arrayGetItem($componentData, self::STATUS, 'inactive');338 $extraData[Constants::STATUS] = $this->getHelper()->getType()->arrayGetItem($componentData, Constants::STATUS, 'inactive'); 338 339 339 340 $fetchedData = array_merge((array)$fetchedData, $extraData); … … 393 394 394 395 $componentData = [ 395 self::NAME => $componentFile,396 Constants::NAME => $componentFile, 396 397 ]; 397 398 } … … 403 404 } 404 405 405 $componentData[ self::TITLE] = $title;406 $componentData[ self::DESCRIPTION] = $description;406 $componentData[Constants::TITLE] = $title; 407 $componentData[Constants::DESCRIPTION] = $description; 407 408 } 408 409 if ($componentData) { 409 410 410 if (!isset($componentData[ self::NAME])) {411 412 $componentData[ self::NAME] = $componentFile;411 if (!isset($componentData[Constants::NAME])) { 412 413 $componentData[Constants::NAME] = $componentFile; 413 414 } 414 415 $components[$componentFile] = $componentData; … … 434 435 $typeHelper = $this->getHelper()->getType(); 435 436 436 $aName = $typeHelper->arrayGetItem($a, self::NAME);437 $bName = $typeHelper->arrayGetItem($b, self::NAME);437 $aName = $typeHelper->arrayGetItem($a, Constants::NAME); 438 $bName = $typeHelper->arrayGetItem($b, Constants::NAME); 438 439 439 440 return strnatcasecmp($aName, $bName); -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Pmpr.php
r3142498 r3154429 7 7 use Pmpr\Plugin\Pmpr\Component\Update; 8 8 use Pmpr\Plugin\Pmpr\Container\Container; 9 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 9 10 use Pmpr\Plugin\Pmpr\REST\REST; 10 11 use Pmpr\Plugin\Pmpr\Traits\ManagerTrait; … … 18 19 use ManagerTrait; 19 20 20 const ACTIVE_COMPONENTS = self::PLUGIN_PREFIX . 'active_components';21 const ACTIVE_COMPONENTS = Constants::PLUGIN_PREFIX . 'active_components'; 21 22 22 23 /** … … 33 34 public function addActions() 34 35 { 35 $this->addAction('admin_menu', [$this, 'adminMenu']) 36 ->addAction('admin_notices', [$this, 'adminNotice']) 37 ->addAction('plugins_loaded', [$this, 'pluginsLoaded']) 38 ->addAction('admin_enqueue_scripts', [$this, 'enqueue']) 39 ->addAction('admin_head', [$this, 'addFontStyle'], 9999); 36 $this 37 ->addAction('admin_menu', [$this, 'adminMenu']) 38 ->addAction('admin_notices', [$this, 'adminNotice']) 39 ->addAction('plugins_loaded', [$this, 'pluginsLoaded']) 40 ->addAction('admin_enqueue_scripts', [$this, 'enqueue']) 41 ->addAction('admin_head', [$this, 'addFontStyle'], 9999) 42 ; 40 43 } 41 44 … … 49 52 } 50 53 54 public function getAPIKey() 55 { 56 return $this->getHelper()->getSetting()->getAPIKey(); 57 } 58 51 59 public function loadRequirement() 52 60 { 53 REST::getInstance();54 Setting::getInstance();55 61 Component::getInstance(); 56 62 if (is_admin()) { 57 63 58 Ajax::getInstance(); 59 Asset::getInstance(); 64 Setting::getInstance(); 65 if ($this->getHelper()->getTool()->isAjax()) { 66 Ajax::getInstance(); 67 } else { 68 Asset::getInstance(); 69 } 70 if (wp_is_rest_endpoint()) { 71 REST::getInstance(); 72 } 60 73 } 61 74 … … 63 76 $filepath = $fileHelper->getPath('/vendor/woocommerce/action-scheduler/action-scheduler.php'); 64 77 if ($fileHelper->exists($filepath)) { 65 66 78 require_once $filepath; 67 79 } … … 137 149 138 150 $HTMLHelper->renderTemplate('setting/remote/side', [ 139 'url' => $this->get PMPRBaseURL(),151 'url' => $this->getHelper()->getTool()->getPMPRBaseURL(), 140 152 'logo' => $logo, 141 153 'items' => $badges, 142 'title' => $typeHelper->arrayGetItem($side, self::TITLE),154 'title' => $typeHelper->arrayGetItem($side, Constants::TITLE), 143 155 'stackoverflow' => $stackoverflow, 144 156 ]); … … 147 159 } 148 160 149 if ($title = $typeHelper->arrayGetItem($remoteTab, self::TITLE)) {161 if ($title = $typeHelper->arrayGetItem($remoteTab, Constants::TITLE)) { 150 162 151 163 $tabs['remote-tab'] = [ 152 self::PRIORITY => 1,153 self::TITLE => $title,154 self::FIELDS => $fields,155 self::SIDEBAR => $sidebar,156 self::NO_SUBMIT => true,164 Constants::PRIORITY => 1, 165 Constants::TITLE => $title, 166 Constants::FIELDS => $fields, 167 Constants::SIDEBAR => $sidebar, 168 Constants::NO_SUBMIT => true, 157 169 ]; 158 170 } … … 185 197 if (current_user_can('manage_options')) { 186 198 187 $links[] = $this->get SettingLinkElement(__('Setting', PR__PLG__PMPR));199 $links[] = $this->getHelper()->getSetting()->getLinkElement(__('Setting', PR__PLG__PMPR)); 188 200 } 189 201 … … 215 227 public function adminNotice() 216 228 { 217 $this-> requirementsNotices(true);229 $this->getHelper()->getComponent()->requirementsNotices(true); 218 230 $updateInstance = Update::getInstance(); 219 231 if (!$updateInstance->isCurrentPage() … … 231 243 ), 232 244 [ 233 self::ID => 'update_components',234 self::TYPE => 'primary',245 Constants::ID => 'update_components', 246 Constants::TYPE => 'primary', 235 247 ] 236 248 ); … … 286 298 if ($componentHelper->isInstalled($component)) { 287 299 288 $componentHelper->changeStatus($component, self::ACTIVE);289 } 290 } 291 } 292 293 delete_transient( self::FETCHED_REQUIRED_COMPONENTS);300 $componentHelper->changeStatus($component, Constants::ACTIVE); 301 } 302 } 303 } 304 305 delete_transient(Constants::FETCHED_REQUIRED_COMPONENTS); 294 306 295 307 $this->getManager()->fetchAndStoreAPIKey(); … … 299 311 { 300 312 $types = [ 301 self::MDL,302 self::CVR,303 self::CST,313 Constants::MDL, 314 Constants::CVR, 315 Constants::CST, 304 316 ]; 305 317 … … 311 323 foreach ($components as $component) { 312 324 313 if ($componentHelper->changeStatus($component, self::INACTIVE)) {325 if ($componentHelper->changeStatus($component, Constants::INACTIVE)) { 314 326 315 327 $activeComponents[] = $component; … … 320 332 update_option(self::ACTIVE_COMPONENTS, $activeComponents); 321 333 322 delete_transient( self::FETCHED_REQUIRED_COMPONENTS);334 delete_transient(Constants::FETCHED_REQUIRED_COMPONENTS); 323 335 } 324 336 325 337 public function adminMenu() 326 338 { 327 $count = $this-> applyFilters('pmpr_components_update_count', 0);339 $count = $this->getHelper()->getComponent()->getUpdateCount(); 328 340 $title = sprintf("%s %s", __('Pmpr', PR__PLG__PMPR), $this->getHelper()->getHTML()->createBubbleNotification($count)); 329 341 add_menu_page($title, $title, 'manage_options', PR__PLG__PMPR, null, $this->getLogoIcon(), 0); … … 344 356 if ($font = $this->getFontURL()) { 345 357 346 $handle = self::PLUGIN_PREFIX . '-admin-font';358 $handle = Constants::PLUGIN_PREFIX . '-admin-font'; 347 359 wp_register_style($handle, $font); 348 360 wp_enqueue_style($handle); … … 380 392 public function getFontName() 381 393 { 382 return $this->get SettingOption(Setting::ADMIN_FONT, 'Vazir');394 return $this->getHelper()->getSetting()->getOption(Setting::ADMIN_FONT, 'Vazir'); 383 395 } 384 396 … … 388 400 public function getFontURL() 389 401 { 390 $font = $this->get SettingObject()->getFonts($this->getFontName());402 $font = $this->getHelper()->getSetting()->getFonts($this->getFontName()); 391 403 if (!is_string($font)) { 392 404 -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Queue.php
r3078046 r3154429 8 8 use Exception; 9 9 use Pmpr\Plugin\Pmpr\Container\Container; 10 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 10 11 11 12 /** … … 87 88 // TODO: When v3.3.0 from Action Scheduler is commonly used use the array notation for status to reduce search queries to one. 88 89 $pendingActions = $this->search([ 89 self::HOOK => $hook,90 self::STATUS => self::PENDING,91 ], self::IDS);90 Constants::HOOK => $hook, 91 Constants::STATUS => Constants::PENDING, 92 ], Constants::IDS); 92 93 93 94 if (1 < count($pendingActions)) { … … 98 99 99 100 $runningActions = $this->search([ 100 self::HOOK => $hook,101 self::STATUS => self::IN_PROGRESS,102 ], self::IDS);101 Constants::HOOK => $hook, 102 Constants::STATUS => Constants::IN_PROGRESS, 103 ], Constants::IDS); 103 104 104 105 if (1 === count($pendingActions) + count($runningActions)) { … … 155 156 $query = [ 156 157 'hook' => $hook, 157 'status' => self::PENDING,158 'status' => Constants::PENDING, 158 159 'group' => $this->getGroup(), 159 160 'orderby' => 'none', … … 327 328 public function exists(array $args): bool 328 329 { 329 $rowFound = $this->search($args, self::IDS);330 $rowFound = $this->search($args, Constants::IDS); 330 331 331 332 return count($rowFound) > 0; -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/REST/Controller.php
r3078042 r3154429 3 3 namespace Pmpr\Plugin\Pmpr\REST; 4 4 5 use Pmpr\Plugin\Pmpr\Interfaces\Constant Interface;5 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 6 6 use Pmpr\Plugin\Pmpr\Traits\APITrait; 7 use Pmpr\Plugin\Pmpr\Traits\CommonTrait;8 7 use Pmpr\Plugin\Pmpr\Traits\HelperTrait; 9 8 use Pmpr\Plugin\Pmpr\Traits\ManagerTrait; 10 use Pmpr\Plugin\Pmpr\Traits\SettingTrait;11 9 use WP_Error; 12 10 use WP_HTTP_Response; … … 20 18 * @package Pmpr\Plugin\Pmpr\REST 21 19 */ 22 class Controller extends WP_REST_Controller implements ConstantInterface20 class Controller extends WP_REST_Controller 23 21 { 24 22 use APITrait, 25 CommonTrait,26 23 HelperTrait, 27 ManagerTrait, 28 SettingTrait; 24 ManagerTrait; 29 25 30 26 public function __construct() … … 43 39 { 44 40 $args = wp_parse_args($args, [ 45 self::ARGS => [],46 self::METHODS => WP_REST_Server::READABLE,47 self::PERMISSION_CALLBACK => [$this, 'permissionCheck'],41 Constants::ARGS => [], 42 Constants::METHODS => WP_REST_Server::READABLE, 43 Constants::PERMISSION_CALLBACK => [$this, 'permissionCheck'], 48 44 ]); 49 45 … … 54 50 { 55 51 $this->register('push-update', [ 56 self::ARGS => [],57 self::METHODS => WP_REST_Server::CREATABLE,58 self::CALLBACK => [$this, 'pushUpdate']52 Constants::ARGS => [], 53 Constants::METHODS => WP_REST_Server::CREATABLE, 54 Constants::CALLBACK => [$this, 'pushUpdate'] 59 55 ]); 60 56 } … … 67 63 public function pushUpdate(WP_REST_Request $request) 68 64 { 69 $token = $request->get_param('token'); 70 $version = $request->get_param(self::VERSION); 71 $component = $request->get_param(self::COMPONENT); 72 if ($token && $component && $version) { 73 74 if ($token === $this->getAPIKey()) { 75 76 $componentHelper = $this->getHelper()->getComponent(); 77 78 if ($componentHelper->isInstalled($component)) { 79 80 $component = $componentHelper->getData($component); 81 if (version_compare($component[self::VERSION] ?? '', $version, '<')) { 82 83 if ($this->getManager()->update($component, $message, $version)) { 84 85 $response = $this->successResponse(__('Your request is ok.', PR__PLG__PMPR)); 86 } else { 87 88 $response = $this->wpError(sprintf(__('Something wrong on install update for %s: %s', PR__PLG__PMPR), $component, $message), 'Error'); 89 } 90 } else { 91 92 $response = $this->wpError(sprintf(__('Version %s or higher version already installed.', PR__PLG__PMPR), $version), 'Already Installed'); 93 } 94 } else { 95 96 $response = $this->wpError(sprintf(__('%s not installed in %s', PR__PLG__PMPR), $component, get_home_url()), 'Bad Request'); 97 } 98 } else { 99 100 $response = $this->wpError(__('Your request is not valid.', PR__PLG__PMPR), 'Request Denied'); 101 } 102 } else { 103 104 $response = $this->wpError(__('Require parameters missing.', PR__PLG__PMPR), 'Bad Request'); 105 } 65 // $token = $request->get_param('token'); 66 // $version = $request->get_param(Constants::VERSION); 67 // $component = $request->get_param(Constants::COMPONENT); 68 // if ($token && $component && $version) { 69 // 70 // if ($token === $this->getAPIKey()) { 71 // 72 // $componentHelper = $this->getHelper()->getComponent(); 73 // 74 // if ($componentHelper->isInstalled($component)) { 75 // 76 // $component = $componentHelper->getData($component); 77 // if (version_compare($component[Constants::VERSION] ?? '', $version, '<')) { 78 // 79 // if ($this->getManager()->updateAll()) { 80 // 81 // $response = $this->successResponse(__('Your request is ok.', PR__PLG__PMPR)); 82 // } else { 83 // 84 // $response = $this->wpError(sprintf(__('Something wrong on install update for %s: %s', PR__PLG__PMPR), $component, $message), 'Error'); 85 // } 86 // } else { 87 // 88 // $response = $this->wpError(sprintf(__('Version %s or higher version already installed.', PR__PLG__PMPR), $version), 'Already Installed'); 89 // } 90 // } else { 91 // 92 // $response = $this->wpError(sprintf(__('%s not installed in %s', PR__PLG__PMPR), $component, get_home_url()), 'Bad Request'); 93 // } 94 // } else { 95 // 96 // $response = $this->wpError(__('Your request is not valid.', PR__PLG__PMPR), 'Request Denied'); 97 // } 98 // } else { 99 // 100 // $response = $this->wpError(__('Require parameters missing.', PR__PLG__PMPR), 'Bad Request'); 101 // } 102 $response = $this->getHelper()->getTool()->wpError(__('it\'s deprecated.', PR__PLG__PMPR), 'deprecated'); 106 103 107 104 return rest_ensure_response($response); -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Setting.php
r3140039 r3154429 4 4 5 5 use Pmpr\Plugin\Pmpr\Container\Container; 6 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 6 7 use WP_Error; 7 8 … … 17 18 const CONTACT = 'contact'; 18 19 19 const SETTING_KEY = self::PLUGIN_PREFIX . 'settings';20 const SETTING_KEY = Constants::PLUGIN_PREFIX . 'settings'; 20 21 const APIKEY = 'apikey'; 21 22 const ADMIN_FONT = 'admin_font'; … … 30 31 */ 31 32 public array $success = []; 33 34 /** 35 * @var array 36 */ 37 protected array $options = []; 32 38 33 39 public function __construct() … … 75 81 private function showNotice(array $messages, string $type = 'warning') 76 82 { 77 $this->getHelper()->getHTML()->renderNotice($messages, [ self::TYPE => $type]);83 $this->getHelper()->getHTML()->renderNotice($messages, [Constants::TYPE => $type]); 78 84 } 79 85 … … 117 123 if ($value) { 118 124 119 if (!$this-> isRequirementsSatisfied(false)) {125 if (!$this->getHelper()->getComponent()->isRequirementsSatisfied(false)) { 120 126 121 127 $this->getError()->add('requirements_not_satisfied', __('Requirements not satisfied', PR__PLG__PMPR)); … … 157 163 $tab = $this->getCurrentTab(); 158 164 $fields = []; 159 if ($tab && isset($tab[ self::FIELDS])) {160 161 $fields = $tab[ self::FIELDS];165 if ($tab && isset($tab[Constants::FIELDS])) { 166 167 $fields = $tab[Constants::FIELDS]; 162 168 } 163 169 … … 172 178 $serverHelper = $this->getHelper()->getServer(); 173 179 174 $tab = $serverHelper->getGet( self::TAB);180 $tab = $serverHelper->getGet(Constants::TAB); 175 181 $tabs = $this->getTabs(); 176 182 if (!$tab) { 177 183 178 $tab = $serverHelper->getPost( self::TAB);184 $tab = $serverHelper->getPost(Constants::TAB); 179 185 } 180 186 if (!$tab || !isset($tabs[$tab])) { … … 184 190 185 191 $current = $tabs[$tab]; 186 $current[ self::ID] = $tab;192 $current[Constants::ID] = $tab; 187 193 188 194 return $current; … … 197 203 $tabs = [ 198 204 self::GENERAL => [ 199 self::PRIORITY => 10,200 self::TITLE => __('General', PR__PLG__PMPR),201 self::FIELDS => [205 Constants::PRIORITY => 10, 206 Constants::TITLE => __('General', PR__PLG__PMPR), 207 Constants::FIELDS => [ 202 208 self::APIKEY => [ 203 209 'type' => 'text', … … 225 231 ], 226 232 self::CONTACT => [ 227 self::PRIORITY => 20,228 self::TITLE => __('Contact', PR__PLG__PMPR),229 self::FIELDS => [233 Constants::PRIORITY => 20, 234 Constants::TITLE => __('Contact', PR__PLG__PMPR), 235 Constants::FIELDS => [ 230 236 'contact' => [ 231 237 'label' => __('Contact US', PR__PLG__PMPR), 232 238 'html' => $HTMLHelper->createElement('a', [ 233 'href' => $this->get PMPRBaseURL('contact'),239 'href' => $this->getHelper()->getTool()->getPMPRBaseURL('contact'), 234 240 'class' => 'button', 235 241 'target' => '_blank', … … 253 259 ], 254 260 ], 255 self::NO_SUBMIT => true,261 Constants::NO_SUBMIT => true, 256 262 ], 257 263 ]; … … 266 272 if ($tab) { 267 273 268 foreach ($tab[ self::FIELDS] as $field => $args) {274 foreach ($tab[Constants::FIELDS] as $field => $args) { 269 275 270 276 if ($args) { 271 277 272 $args[ self::VALUE] = $this->getValue($field);273 274 $tab[ self::FIELDS][$field] = $args;278 $args[Constants::VALUE] = $this->getValue($field); 279 280 $tab[Constants::FIELDS][$field] = $args; 275 281 } 276 282 } … … 279 285 $HTMLHelper = $this->getHelper()->getHTML(); 280 286 281 $tabs = $this->getHelper()->getType()->arraySort($tabs, self::PRIORITY);287 $tabs = $this->getHelper()->getType()->arraySort($tabs, Constants::PRIORITY); 282 288 283 289 $HTMLHelper->renderTemplate('setting/index', [ 284 290 'tabs' => $tabs, 285 self::ID => self::SETTING_KEY,291 Constants::ID => self::SETTING_KEY, 286 292 'current' => $tab, 287 293 ]); … … 361 367 public function getOptions(): array 362 368 { 363 $options = wp_cache_get(self::SETTING_KEY, 'setting'); 364 if (!$options) { 365 366 $options = get_option(self::SETTING_KEY, []); 367 if ($options) { 368 369 $options = maybe_unserialize($options); 370 wp_cache_set(self::SETTING_KEY, $options, 'setting'); 369 if (empty($this->options)) { 370 371 $options = wp_cache_get(self::SETTING_KEY, 'setting'); 372 if (!$options) { 373 374 $options = get_option(self::SETTING_KEY, []); 375 if ($options) { 376 377 $options = maybe_unserialize($options); 378 wp_cache_set(self::SETTING_KEY, $options, 'setting'); 379 } 371 380 } 372 } 373 374 return (array)$options; 381 if(is_array($options)) { 382 $this->options = $options; 383 } 384 } 385 386 return $this->options; 375 387 } 376 388 … … 396 408 public function isSettingPage(): bool 397 409 { 398 return $this->getHelper()->getServer()->getGet( self::PAGE, '') === self::SETTING_KEY;410 return $this->getHelper()->getServer()->getGet(Constants::PAGE, '') === self::SETTING_KEY; 399 411 } 400 412 … … 407 419 { 408 420 $args = [ 409 self::PAGE => self::SETTING_KEY,421 Constants::PAGE => self::SETTING_KEY, 410 422 ]; 411 423 if ($tab) { 412 424 413 $args[ self::TAB] = $tab;425 $args[Constants::TAB] = $tab; 414 426 } 415 427 … … 474 486 return $fonts; 475 487 } 488 489 /** 490 * @param $apikey 491 * 492 * @return bool|string 493 */ 494 public function getAPIKey($apikey = '') 495 { 496 $apikey = (string)$this->getOption(self::APIKEY, $apikey); 497 498 if ($apikey && strlen($apikey) !== Constants::APIKEY_LENGTH) { 499 500 $apikey = false; 501 } 502 return $apikey; 503 } 504 505 /** 506 * @param string $text 507 * @param string $tab 508 * @param array $attrs 509 * 510 * @return string 511 */ 512 public function getLinkElement(string $text, string $tab = '', array $attrs = []): string 513 { 514 $attrs['href'] = $this->getPageURL($tab); 515 $attrs['class'] = 'text-decoration-none'; 516 return $this->getHelper()->getHTML()->createElement('a', $attrs, $text); 517 } 476 518 } -
pmpr-ir/trunk/template/modal.php
r3078042 r3154429 1 1 <?php 2 2 3 use Pmpr\Plugin\Pmpr\Interfaces\Constant Interface;3 use Pmpr\Plugin\Pmpr\Interfaces\Constants; 4 4 5 5 if (!defined('ABSPATH')) { … … 40 40 } else if (is_array($step)) { 41 41 42 $template = $step[Constant Interface::TEMPLATE] ?? '';42 $template = $step[Constants::TEMPLATE] ?? ''; 43 43 if ($template) { 44 44 … … 46 46 } else { 47 47 48 $content = $step[Constant Interface::CONTENT] ?? '';48 $content = $step[Constants::CONTENT] ?? ''; 49 49 } 50 50 51 $image = $step[Constant Interface::IMAGE] ?? '';51 $image = $step[Constants::IMAGE] ?? ''; 52 52 if ($image) { 53 53 … … 60 60 } 61 61 62 $title = $step[Constant Interface::TITLE] ?? '';62 $title = $step[Constants::TITLE] ?? ''; 63 63 if ($title) { 64 64 -
pmpr-ir/trunk/vendor/composer/autoload_classmap.php
r3140903 r3154429 48 48 'Pmpr\\Plugin\\Pmpr\\Helper\\Hook' => $baseDir . '/src/Pmpr/Plugin/Pmpr/Helper/Hook.php', 49 49 'Pmpr\\Plugin\\Pmpr\\Helper\\Server' => $baseDir . '/src/Pmpr/Plugin/Pmpr/Helper/Server.php', 50 'Pmpr\\Plugin\\Pmpr\\Helper\\Tool' => $baseDir . '/src/Pmpr/Plugin/Pmpr/Helper/Tool.php', 50 51 'Pmpr\\Plugin\\Pmpr\\Helper\\Type' => $baseDir . '/src/Pmpr/Plugin/Pmpr/Helper/Type.php', 51 'Pmpr\\Plugin\\Pmpr\\Interfaces\\Constant Interface' => $baseDir . '/src/Pmpr/Plugin/Pmpr/Interfaces/ConstantInterface.php',52 'Pmpr\\Plugin\\Pmpr\\Interfaces\\Constants' => $baseDir . '/src/Pmpr/Plugin/Pmpr/Interfaces/Constants.php', 52 53 'Pmpr\\Plugin\\Pmpr\\Manager' => $baseDir . '/src/Pmpr/Plugin/Pmpr/Manager.php', 53 54 'Pmpr\\Plugin\\Pmpr\\Pmpr' => $baseDir . '/src/Pmpr/Plugin/Pmpr/Pmpr.php', … … 57 58 'Pmpr\\Plugin\\Pmpr\\Setting' => $baseDir . '/src/Pmpr/Plugin/Pmpr/Setting.php', 58 59 'Pmpr\\Plugin\\Pmpr\\Traits\\APITrait' => $baseDir . '/src/Pmpr/Plugin/Pmpr/Traits/APITrait.php', 59 'Pmpr\\Plugin\\Pmpr\\Traits\\CommonTrait' => $baseDir . '/src/Pmpr/Plugin/Pmpr/Traits/CommonTrait.php',60 60 'Pmpr\\Plugin\\Pmpr\\Traits\\HelperTrait' => $baseDir . '/src/Pmpr/Plugin/Pmpr/Traits/HelperTrait.php', 61 61 'Pmpr\\Plugin\\Pmpr\\Traits\\HookTrait' => $baseDir . '/src/Pmpr/Plugin/Pmpr/Traits/HookTrait.php', 62 62 'Pmpr\\Plugin\\Pmpr\\Traits\\ManagerTrait' => $baseDir . '/src/Pmpr/Plugin/Pmpr/Traits/ManagerTrait.php', 63 'Pmpr\\Plugin\\Pmpr\\Traits\\SettingTrait' => $baseDir . '/src/Pmpr/Plugin/Pmpr/Traits/SettingTrait.php',64 63 ); -
pmpr-ir/trunk/vendor/composer/autoload_static.php
r3140903 r3154429 63 63 'Pmpr\\Plugin\\Pmpr\\Helper\\Hook' => __DIR__ . '/../..' . '/src/Pmpr/Plugin/Pmpr/Helper/Hook.php', 64 64 'Pmpr\\Plugin\\Pmpr\\Helper\\Server' => __DIR__ . '/../..' . '/src/Pmpr/Plugin/Pmpr/Helper/Server.php', 65 'Pmpr\\Plugin\\Pmpr\\Helper\\Tool' => __DIR__ . '/../..' . '/src/Pmpr/Plugin/Pmpr/Helper/Tool.php', 65 66 'Pmpr\\Plugin\\Pmpr\\Helper\\Type' => __DIR__ . '/../..' . '/src/Pmpr/Plugin/Pmpr/Helper/Type.php', 66 'Pmpr\\Plugin\\Pmpr\\Interfaces\\Constant Interface' => __DIR__ . '/../..' . '/src/Pmpr/Plugin/Pmpr/Interfaces/ConstantInterface.php',67 'Pmpr\\Plugin\\Pmpr\\Interfaces\\Constants' => __DIR__ . '/../..' . '/src/Pmpr/Plugin/Pmpr/Interfaces/Constants.php', 67 68 'Pmpr\\Plugin\\Pmpr\\Manager' => __DIR__ . '/../..' . '/src/Pmpr/Plugin/Pmpr/Manager.php', 68 69 'Pmpr\\Plugin\\Pmpr\\Pmpr' => __DIR__ . '/../..' . '/src/Pmpr/Plugin/Pmpr/Pmpr.php', … … 72 73 'Pmpr\\Plugin\\Pmpr\\Setting' => __DIR__ . '/../..' . '/src/Pmpr/Plugin/Pmpr/Setting.php', 73 74 'Pmpr\\Plugin\\Pmpr\\Traits\\APITrait' => __DIR__ . '/../..' . '/src/Pmpr/Plugin/Pmpr/Traits/APITrait.php', 74 'Pmpr\\Plugin\\Pmpr\\Traits\\CommonTrait' => __DIR__ . '/../..' . '/src/Pmpr/Plugin/Pmpr/Traits/CommonTrait.php',75 75 'Pmpr\\Plugin\\Pmpr\\Traits\\HelperTrait' => __DIR__ . '/../..' . '/src/Pmpr/Plugin/Pmpr/Traits/HelperTrait.php', 76 76 'Pmpr\\Plugin\\Pmpr\\Traits\\HookTrait' => __DIR__ . '/../..' . '/src/Pmpr/Plugin/Pmpr/Traits/HookTrait.php', 77 77 'Pmpr\\Plugin\\Pmpr\\Traits\\ManagerTrait' => __DIR__ . '/../..' . '/src/Pmpr/Plugin/Pmpr/Traits/ManagerTrait.php', 78 'Pmpr\\Plugin\\Pmpr\\Traits\\SettingTrait' => __DIR__ . '/../..' . '/src/Pmpr/Plugin/Pmpr/Traits/SettingTrait.php',79 78 ); 80 79 -
pmpr-ir/trunk/vendor/composer/installed.php
r3152426 r3154429 1 1 <?php return array( 2 2 'root' => array( 3 'pretty_version' => '1. 3.8',4 'version' => '1. 3.8.0',3 'pretty_version' => '1.4.0', 4 'version' => '1.4.0.0', 5 5 'type' => 'project', 6 6 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'pmpr/wp-plg-pmpr' => array( 14 'pretty_version' => '1. 3.8',15 'version' => '1. 3.8.0',14 'pretty_version' => '1.4.0', 15 'version' => '1.4.0.0', 16 16 'type' => 'project', 17 17 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.