84% jpd2

Code Review | JPD2

WordPress plugin JPD2 scored84%from 54 tests.

About plugin

  • Plugin page: jpd2
  • Plugin version: 0.8.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-3.8.1
  • WordPress version: 6.3.1
  • First release: Mar 8, 2014
  • Latest release: Feb 24, 2022
  • Number of updates: 19
  • Update frequency: every 153.2 days
  • Top authors: Shelob9 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,912 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼0.67MB] [CPU: ▼10.16ms] Passed 4 tests

Server-side resources used by JPD2
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0144.55 ▲6.81
Dashboard /wp-admin3.31 ▲0.0149.92 ▲2.61
Posts /wp-admin/edit.php3.37 ▲0.0148.25 ▲3.60
Add New Post /wp-admin/post-new.php3.20 ▼2.6935.58 ▼53.64
Media Library /wp-admin/upload.php3.24 ▲0.0141.22 ▲6.91

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

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

Browser metrics Passed 4 tests

A check of browser resources used by JPD2
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.49 ▲0.141.69 ▲0.1345.74 ▲5.60
Dashboard /wp-admin2,198 ▲215.61 ▲0.0389.20 ▼0.8340.81 ▲0.38
Posts /wp-admin/edit.php2,100 ▼32.01 ▲0.0233.35 ▼1.5234.69 ▼0.69
Add New Post /wp-admin/post-new.php1,526 ▼023.23 ▲0.02638.83 ▼69.4752.25 ▼4.13
Media Library /wp-admin/upload.php1,403 ▲34.15 ▼0.0896.50 ▼2.7642.16 ▼3.48

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not 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
Please take a closer look at the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/jpd2/jpd2.php:56
    • > PHP Warning
      Use of undefined constant DAY_IN_SECONDS - assumed 'DAY_IN_SECONDS' (this will throw an Error in a future version of PHP) in wp-content/plugins/jpd2/jpd2.php on line 17
    • > PHP Warning
      Use of undefined constant DAY_IN_SECONDS - assumed 'DAY_IN_SECONDS' (this will throw an Error in a future version of PHP) in wp-content/plugins/jpd2/output/jpd2.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/jpd2/output/jpd2.php:56

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Screenshots: Please add an image for screenshot #1 (Example usage.)
You can take inspiration from this readme.txt

jpd2/jpd2.php Passed 13 tests

Analyzing the main PHP file in "JPD2" version 0.8.7
60 characters long description:
Makes caching WordPress queries via the Transients API easy.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin699 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP11243293669
JSON22030

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity20.20
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods94
▷ Static methods3234.04%
▷ Public methods9095.74%
▷ Protected methods00.00%
▷ Private methods44.26%
Functions12
▷ Named functions1083.33%
▷ Anonymous functions216.67%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin