10% plugin-directory-stats

Code Review | Plugin Directory Stats

WordPress plugin Plugin Directory Stats scored10%from 54 tests.

About plugin

  • Plugin page: plugin-directory-...
  • Plugin version: 0.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.3.1
  • WordPress version: 6.3.1
  • First release: Mar 5, 2012
  • Latest release: May 15, 2012
  • Number of updates: 26
  • Update frequency: every 2.7 days
  • Top authors: redcocker (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /3,958 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/plugin-directory-stats/plugin-directory-stats.php+63
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼0.82MB] [CPU: ▼34.23ms] Passed 4 tests

This is a short check of server-side resources used by Plugin Directory Stats
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1340.68 ▲0.62
Dashboard /wp-admin3.16 ▼0.1823.99 ▼24.40
Posts /wp-admin/edit.php3.16 ▼0.2328.03 ▼22.23
Add New Post /wp-admin/post-new.php3.16 ▼2.7624.99 ▼81.00
Media Library /wp-admin/upload.php3.16 ▼0.1025.40 ▼9.28
Plugin Dir Stats /wp-admin/options-general.php?page=plugin-dir-stats-options3.1627.73

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

Filesystem and database footprint
No storage issues were detected
Filesystem: no files
Database: 1 new table, 10 new options
New tables
wp_plugin_dir_stats
New WordPress options
widget_recent-comments
widget_recent-posts
plugin_dir_stats_setting_opt
db_upgraded
can_compress_scripts
recovery_mode_email_last_sent
theysaidso_admin_options
plugin_dir_stats_checkver_stamp
widget_theysaidso_widget
plugin_dir_stats_updated

Browser metrics Passed 4 tests

Checking browser requirements for Plugin Directory Stats
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲9613.61 ▼0.831.75 ▲0.0140.65 ▲1.64
Dashboard /wp-admin2,226 ▲415.90 ▲0.09100.95 ▼1.0938.47 ▼6.42
Posts /wp-admin/edit.php2,105 ▲162.01 ▼0.0339.17 ▼9.8637.36 ▼2.37
Add New Post /wp-admin/post-new.php1,544 ▲3023.16 ▲5.60619.51 ▼41.2563.70 ▼0.91
Media Library /wp-admin/upload.php1,405 ▲204.24 ▲0.0596.02 ▼9.7744.69 ▼2.79
Plugin Dir Stats /wp-admin/options-general.php?page=plugin-dir-stats-options8141.536.7226.62

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/plugin-directory-stats/plugin-directory-stats.php+147
    Undefined variable: plugin_dir_stats_page_hook
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=plugin-dir-stats-options
    • > Notice in wp-content/plugins/plugin-directory-stats/plugin-directory-stats.php+150
    Undefined variable: plugin_dir_stats_page_hook
    • > GET request to /wp-admin/options-general.php?page=plugin-dir-stats-options
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=plugin-dir-stats-options
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=plugin-dir-stats-options
    • > Error in wp-content/plugins/plugin-directory-stats/plugin-directory-stats-admin.php+87
    Uncaught Error: Call to undefined function mysql_get_server_info() in wp-content/plugins/plugin-directory-stats/plugin-directory-stats-admin.php:87
    Stack trace:
    #0 wp-content/plugins/plugin-directory-stats/plugin-directory-stats.php(764): include_once()
    #1 wp-includes/class-wp-hook.php(310): PLUGIN_DIRECTORY_STATS->plugin_dir_stats_options_panel()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #6 {main}
    thrown

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
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/plugin-directory-stats/plugin-directory-stats.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/plugin-directory-stats/plugin-directory-stats-admin.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (This is a plugin stats.), #2 (This is a list by author.), #3 (This is setting panel.)
The official readme.txt might help

plugin-directory-stats/plugin-directory-stats.php 92% from 13 tests

The main PHP script in "Plugin Directory Stats" version 0.1.4 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected777 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP317767645
PO File14849111
JavaScript14121

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity66.00
▷ Minimum class complexity66.00
▷ Maximum class complexity66.00
Average method complexity2.76
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods37
▷ Static methods00.00%
▷ Public methods37100.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
No PNG files were detected