84% category-for-pages

Code Review | Category For Pages

WordPress plugin Category For Pages scored84%from 54 tests.

About plugin

  • Plugin page: category-for-pages
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.7
  • WordPress version: 6.3.1
  • First release: Feb 19, 2017
  • Latest release: Feb 19, 2017
  • Number of updates: 3
  • Update frequency: every 0.7 days
  • Top authors: parvezbrta (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active /3,480 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.00MB] [CPU: ▼8.32ms] Passed 4 tests

Server-side resources used by Category For Pages
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.38 ▼4.76
Dashboard /wp-admin3.31 ▼0.0348.07 ▼14.22
Posts /wp-admin/edit.php3.36 ▲0.0149.65 ▼5.64
Add New Post /wp-admin/post-new.php5.91 ▲0.0396.04 ▼8.66
Media Library /wp-admin/upload.php3.23 ▲0.0135.56 ▼3.28
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=page3.2334.55
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=page3.2340.04

Server storage [IO: ▲0.10MB] [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, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
category_children
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Category For Pages
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲5213.65 ▼0.935.24 ▲3.2240.57 ▼1.92
Dashboard /wp-admin2,229 ▲264.86 ▼1.00109.16 ▲4.1239.39 ▼2.20
Posts /wp-admin/edit.php2,108 ▲82.05 ▲0.0640.28 ▼1.5835.87 ▲0.95
Add New Post /wp-admin/post-new.php1,560 ▲623.27 ▲5.01646.40 ▲29.6952.17 ▲1.19
Media Library /wp-admin/upload.php1,411 ▲144.23 ▲0.01100.75 ▲1.1545.52 ▲3.00
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=page1,3302.1427.8430.55
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=page1,4632.1429.7733.91

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • category_children
    • widget_recent-comments
    • widget_recent-posts

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/category-for-pages/category-for-pages.php:49

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Add an image for screenshot #1 (A screenshot of the WordPress backend Pages section with the Categories metabox and the Tags metabox marked red.)
The official readme.txt might help

category-for-pages/category-for-pages.php Passed 13 tests

The principal PHP file in "Category For Pages" v. 1.0 is loaded by WordPress automatically on each request
54 characters long description:
Adds categories and tags functionality for your pages.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected16 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP194116

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.67
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png59.98KB27.40KB▼ 54.33%