Commit Graph

9 Commits

Author SHA1 Message Date
Yahnis Elsts 317a45dc45 Prevent class_exists() from calling autoloaders.
The update checker uses class_exists in several ways:

- As a guard clause around `class Whatever` definitions. This ensures we don't try to define a class that has already been loaded by a different plugin. In this case, autoloading is not necessary because we already know how to load the class. Also, we *want to* load our version of that class if possible - the version that gets loaded by somebody else's autoloader might be different and incompatible.
- As a guard clause before `require` statements that include a class. This is conceptually the same as the previous example. 
- To enable optional features if Debug Bar is active. The latest compatible version of Debug Bar doesn't use autoloading, so it would again be unnecessary in this case.
2015-06-17 12:30:05 +03:00
Yahnis Elsts b8102edc06 Minor: Operator spacing and naming consistency
By convention, there should be a space before and after a string concatenation operator.
Also, both submit buttons should use a dash to separate the static and variable parts of the element ID.
2015-01-14 16:51:26 +02:00
jrfnl 07366fff49 Prevent some html errors for duplicate ids 2015-01-14 12:51:12 +01:00
Yahnis Elsts d921ed91e8 Added an option to check updates less frequently if there's an update already available.
This feature is disabled by default. Turn it on by setting `$checker->throttleRedundantChecks` to `true` and use `$checker->throttledCheckPeriod` to set the alternate check period (default = every 72 hours).
2013-11-29 04:13:32 -08:00
Yahnis Elsts 2edd17e0a5 Fix a conflict with WordPress' "quick edit" feature.
Explanation:
WordPress includes a "quick edit" function that lets users edit certain post properties (title, categories, etc) from the "All Posts" list. WP calculates the width (colspan attribute) of the inline editor based on the number of <th>'s in the header of the first .widefat table on the page. When PUC and Debug Bar are both active, that first table happens to be the debug info table in our Debug Bar panel. This table does not have a <thead>. As a result, WordPress sets the colspan to zero, making the inline editor unusable.

Fixed by removing the "widefat" class from our debug info tables and adding a bunch of new CSS to emulate WordPress table style.
2013-09-27 03:08:51 -07:00
Yahnis Elsts a0c1dfa732 Add the update checker class name to the Debug Bar output. Useful when trying to figure out which library version was loaded. 2012-11-04 11:46:55 +00:00
Yahnis Elsts a793bb1906 * get_submit_button() is only available in the WP admin, so make sure it exists before trying to output a button.
* HOUR_IN_SECONDS is only defined in WP 3.5+. Use the literal value instead.
2012-10-31 14:34:24 +00:00
Yahnis Elsts 5a3c214836 Fix duplicate IDs in the Debug Bar.
When multiple instances of the update checker are active at the same time, each will have its own PluginUpdateCheckerPanel instance and its own entry in the Debug Bar. However, since all instances have the same class name, and Debug Bar uses this name to generate link and wrapper IDs, we will end up with duplicate IDs and a semi-broken debug bar. 
 
 I've added a bit of JS that will find update checker panels and replace the relevant IDs with new ones based on the plugin slug, not class.
2012-10-27 12:26:24 +00:00
Yahnis Elsts c42810ab70 Add a Debug Bar panel that displays all kinds of debugging information about each update checker instance. You can also trigger an update check and request info/metadata through the panel. 2012-10-26 18:15:09 +00:00