PluginProbe
CSS & JavaScript Toolbox / 10
CSS & JavaScript Toolbox v10
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
← All changes | framework/extensions/extensions.class.php +6 -79 1210 View file →
@@ -53,16 +53,8 @@
53 53 * @var mixed
54 54 */
55 55 protected $incompatibilies;
56 56
57 - /**
58 - * put your comment there...
59 - *
60 - * @var mixed
61 - */
62 - protected $incompatibleAddons = array();
63 -
64 -
65 57 /**
66 58 * put your comment there...
67 59 *
68 60 * @var mixed
@@ -154,9 +146,8 @@
154 146 *
155 147 * @param mixed $className
156 148 */
157 149 public function _autoload($className) {
158 -
159 150 // Load only classed defined on the list!
160 151 if (isset($this->extensions[$className])) {
161 152 $classFile = $this->onautoload($this->extensions[$className]['runtime']['classFile'], $className);
162 153 // Import class file!
@@ -173,34 +164,8 @@
173 164 */
174 165 public function __construct($prefix = self::PREFIXS, $loadMethod = self::LOAD_METHOD) {
175 166 // Hookable!
176 167 parent::__construct();
177 -
178 - // Initialize incomapiblt addons meta data
179 - $this->incompatibleAddons = array(
180 -
181 - 'css-javascript-toolbox-plus' => array(
182 - '9.4',
183 - '<',
184 - 'Aborted',
185 -
186 - function() {
187 -
188 - ob_start();
189 -
190 - require CJTOOLBOX_PATH . DIRECTORY_SEPARATOR . 'includes' .
191 - DIRECTORY_SEPARATOR . 'html' . DIRECTORY_SEPARATOR .
192 - 'incompatible_cjtplus_version.html.php';
193 -
194 - $content = ob_get_clean();
195 -
196 - return $content;
197 - }
198 -
199 - ),
200 -
201 - );
202 -
203 168 // Initializing!
204 169 $this->prefix = explode( ',', $prefix );
205 170 $this->loadMethod = $loadMethod;
206 171 }
@@ -281,21 +246,18 @@
281 246 * put your comment there...
282 247 *
283 248 */
284 249 public function load() {
285 -
286 250 // Initialize.
287 251 $frameworkVersion = new CJT_Framework_Version_Version(CJTPlugin::FW_Version);
288 -
289 252 // Auto load CJT extensions files when requested.
290 253 spl_autoload_register($this->ontregisterautoload(array($this, '_autoload')));
291 -
292 254 // Load all CJT extensions!
293 255 foreach ($this->getExtensions() as $class => $extension) {
294 256 // Filters!
295 257 extract($this->onload($extension, compact('class', 'extension')));
296 258 // Build Extension plugin path
297 - $pluginPath = WP_PLUGIN_DIR . "/{$extension['name']}";
259 + $pluginPath = ABSPATH . PLUGINDIR . "/{$extension['name']}";
298 260 // Set runtime variables.
299 261 $this->extensions[$class]['runtime']['classFile'] = "{$pluginPath}/{$extension['name']}.class.php";
300 262 // Load definition.
301 263 $definitionXML = $extension['defDoc'];
@@ -316,33 +278,8 @@
316 278 // Callback filter
317 279 $callback = $this->onloadcallback($callback);
318 280 // If auto load is speicifd then import class file and bind events.
319 281 if ($extension['definition']['primary']['loadMethod'] == 'auto') {
320 -
321 - // Don't load Incompatible extensions/addons
322 - if (isset($this->incompatibleAddons[$extension['name']])) {
323 -
324 - require_once ABSPATH . DIRECTORY_SEPARATOR . 'wp-admin' .
325 - DIRECTORY_SEPARATOR . 'includes' .
326 - DIRECTORY_SEPARATOR . 'plugin.php';
327 -
328 - $incomapatibleAddon = $this->incompatibleAddons[$extension['name']];
329 - $addonVersion = get_plugin_data($extension['pluginFile'], false, false)['Version'];
330 - $currentVersion = get_plugin_data( CJTOOLBOX_PLUGIN_FILE )['Version'];
331 -
332 - // Only show notice if addon version is less than 11.
333 - if ( $addonVersion < 11) {
334 -
335 - $extension['incompatibleMessage']['flag'] = $incomapatibleAddon[2];
336 - $extension['incompatibleMessage']['msg'] = $incomapatibleAddon[3];
337 -
338 - $this->incompatibilies[$pluginPath] = $extension;
339 -
340 - continue;
341 - }
342 -
343 - }
344 -
345 282 // If frameworkVersion is not provided assume its 0 (Older version)
346 283 // before frameworkversion chech even supported.
347 284 // otherwise compare it with current frameworkversion
348 285 // If the version MAJOR is different current
@@ -420,10 +357,8 @@
420 357 *
421 358 * @TODO: REMOVE HTML-MARKUP. CJT PLUGIN NEVER WRITE MARKUP IMIXED WITH HTML. ITS VERY BAD PROGRAMMING PRACTICE. THIS WILL BE REMOVED NEXT TIME AS WE IN RUSH!!!
422 359 */
423 360 public function processIncompatibles() {
424 - global $current_screen;
425 -
426 361 // Proces only if in CJT page.
427 362 if (!preg_match('/\/plugins\.php|page\=cjtoolbox/', $_SERVER['REQUEST_URI'])) {
428 363 return;
429 364 }
@@ -438,24 +373,16 @@
438 373 foreach ($this->incompatibilies as $class => $extension) {
439 374 // Show details.
440 375 $pluginInfo = get_plugin_data($extension['pluginFile']);
441 376 // List item Markup
442 - $list .= is_callable($extension['incompatibleMessage']['msg']) ?
443 - "<li style='list-style-type:none'>{$extension['incompatibleMessage']['msg']()}</li>" :
444 - "<li><a target='_blank' href='{$pluginInfo['PluginURI']}'>{$pluginInfo['Name']}</a> (Status: {$extension['incompatibleMessage']['flag']}, Message: {$extension['incompatibleMessage']['msg']})</li>\n";
377 + $list .= "<li><a target='_blank' href='{$pluginInfo['PluginURI']}'>{$pluginInfo['Name']}</a> (Status: {$extension['incompatibleMessage']['flag']}, Message: {$extension['incompatibleMessage']['msg']})</li>\n";
445 378 }
446 -
447 - $noticeClasses = 'cjt-incomaptible-extensions-notice notice notice-error';
448 -
449 - if ( $current_screen->id !== 'toplevel_page_cjtoolbox' ) {
450 - $noticeClasses .= ' is-dismissible';
451 - }
452 -
453 379 // Output full message.
454 380 // TODO: BAD PRACTICE1!!!!! NEVER MIX HTML WITH PHP, JUST TEMPORARY1!!!
455 - echo "<div class='$noticeClasses' style='font-size:14px;font-weight:bold;margin-top: 20px;'>
456 - <ul style='list-style-type: circle;font-size: 12px;'>{$list}</ul>
457 - </div>";
381 + echo "<div class='cjt-incomaptible-extensions-notice updated' style='font-size:14px;font-weight:bold;padding-top:11px'>
382 + <span>{$message}</span>
383 + <ul style='list-style-type: circle;padding-left: 27px;font-size: 12px;'>{$list}</ul>
384 + </div>";
458 385 }
459 386
460 387 } // End class.
461 388