84% add-category-to-pages

Code Review | Add Category to Pages

WordPress plugin Add Category to Pages scored84%from 54 tests.

About plugin

  • Plugin page: add-category-to-p...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.2.4
  • WordPress version: 6.3.1
  • First release: Jan 17, 2015
  • Latest release: Oct 19, 2019
  • Number of updates: 9
  • Update frequency: every 193.2 days
  • Top authors: a.ankit (100%)

Code review

54 tests

User reviews

30 reviews

Install metrics

30,000+ active /173,315 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

This is a short check of server-side resources used by Add Category to Pages
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.20 ▲1.81
Dashboard /wp-admin3.31 ▼0.0350.36 ▼19.35
Posts /wp-admin/edit.php3.36 ▲0.0144.25 ▼2.32
Add New Post /wp-admin/post-new.php5.91 ▲0.0387.88 ▼17.16
Media Library /wp-admin/upload.php3.24 ▲0.0134.99 ▼0.49
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=page3.2333.27
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=page3.2338.91

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts
category_children
widget_recent-comments

Browser metrics Passed 4 tests

Add Category to Pages: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.17 ▼0.181.61 ▲0.1543.49 ▲3.54
Dashboard /wp-admin2,203 ▲265.59 ▼0.0784.90 ▼2.8038.07 ▼1.14
Posts /wp-admin/edit.php2,108 ▲81.97 ▼0.0137.65 ▲2.0131.74 ▼2.96
Add New Post /wp-admin/post-new.php1,532 ▲423.62 ▲0.63623.70 ▼2.7162.37 ▼5.80
Media Library /wp-admin/upload.php1,408 ▲84.33 ▲0.15105.92 ▲6.8141.81 ▲1.23
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=page1,3272.1128.4230.63
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=page1,4632.1232.4336.08

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • category_children
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 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/add-category-to-pages/add-category-to-page.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% 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 require attention:
  • Screenshots: Screenshot #1 (Page Edit Screen) image not found
The official readme.txt might help

add-category-to-pages/add-category-to-page.php 92% from 13 tests

The principal PHP file in "Add Category to Pages" v. 1.2 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("add-category-to-pages.php" instead of "add-category-to-page.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin17 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP113917

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code1.00
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin