10% disclosure-picker

Code Review | Disclosure Picker

WordPress plugin Disclosure Picker scored10%from 54 tests.

About plugin

  • Plugin page: disclosure-picker
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.1-3.5.1
  • WordPress version: 6.3.1
  • First release: Dec 22, 2012
  • Latest release: Apr 11, 2013
  • Number of updates: 14
  • Update frequency: every 7.9 days
  • Top authors: jbwagner (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /2,600 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)

Server metrics [RAM: ▼1.88MB] [CPU: ▼54.49ms] Passed 4 tests

Server-side resources used by Disclosure Picker
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.11 ▼1.365.18 ▼34.98
Dashboard /wp-admin2.13 ▼1.186.36 ▼41.37
Posts /wp-admin/edit.php2.13 ▼1.237.34 ▼42.29
Add New Post /wp-admin/post-new.php2.13 ▼3.765.62 ▼99.31
Media Library /wp-admin/upload.php2.13 ▼1.105.79 ▼30.13

Server storage [IO: ▲0.06MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Disclosure Picker: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5613.60 ▼0.791.60 ▼0.0839.36 ▼4.12
Dashboard /wp-admin2,209 ▲204.86 ▼0.11101.94 ▼4.3741.33 ▼3.51
Posts /wp-admin/edit.php2,092 ▲32.00 ▼0.0142.14 ▲0.9035.46 ▼2.93
Add New Post /wp-admin/post-new.php6,294 ▲4,76626.26 ▲8.01860.47 ▲257.5557.42 ▲5.94
Media Library /wp-admin/upload.php1,388 ▲34.22 ▲0.0495.53 ▼0.1343.18 ▲1.43

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/disclosure-picker/disclosurepicker.php:41

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === disclosure-picker === )
  • Screenshots: Please add images for these screenshots: #1 (Each post or page can have its own disclosure. Pick from the 5 versions, or choose to have none.), #2 (The disclosure is placed below the content in it's own styled box.)
Please take inspiration from this readme.txt

disclosure-picker/disclosurepicker.php 92% from 13 tests

The entry point to "Disclosure Picker" version 1.1 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("disclosure-picker.php" instead of "disclosurepicker.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin163 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP162127140
PO File10017
CSS1016

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png22.20KB8.87KB▼ 60.04%
screenshot-1.png17.87KB5.70KB▼ 68.09%