84% p2-new-post-categories

Code Review | P2 New Post Categories

WordPress plugin P2 New Post Categories scored84%from 54 tests.

About plugin

  • Plugin page: p2-new-post-categ...
  • Plugin version: 0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.3+
  • WordPress version: 6.3.1
  • First release: Sep 16, 2013
  • Latest release: Dec 4, 2013
  • Number of updates: 15
  • Update frequency: every 5.8 days
  • Top authors: iandunn (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active /4,389 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.85ms] Passed 4 tests

Server-side resources used by P2 New Post Categories
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.22 ▼3.50
Dashboard /wp-admin3.31 ▲0.0154.01 ▼0.68
Posts /wp-admin/edit.php3.36 ▲0.0148.56 ▼5.86
Add New Post /wp-admin/post-new.php5.89 ▲0.0191.33 ▲0.17
Media Library /wp-admin/upload.php3.24 ▲0.0139.80 ▼9.35

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for P2 New Post Categories
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,899 ▲13813.26 ▼0.928.64 ▲6.9343.68 ▲4.31
Dashboard /wp-admin2,194 ▲145.55 ▼0.0889.59 ▼4.6238.58 ▼6.49
Posts /wp-admin/edit.php2,102 ▲21.98 ▼0.0734.84 ▼4.0135.03 ▼2.82
Add New Post /wp-admin/post-new.php1,533 ▲223.11 ▲0.05666.58 ▲61.5955.02 ▼11.35
Media Library /wp-admin/upload.php1,402 ▲84.31 ▲0.07110.95 ▲8.9749.18 ▲1.22

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/p2-new-post-categories/p2-new-post-categories.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tested up to: Invalid version format
Please take inspiration from this readme.txt

p2-new-post-categories/p2-new-post-categories.php Passed 13 tests

The main PHP file in "P2 New Post Categories" ver. 0.3 adds more information about the plugin and also serves as the entry point for this plugin
47 characters long description:
Adds a category dropdown to P2's new post form.

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 plugin90 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1152260
JavaScript17821
CSS1109

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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 images were found in this plugin