84% add-category-to-pages

Code Review | Add Category to Pages

WordPress plugin Add Category to Pages scored 84% 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: 5.9.2
  • 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 / 158,002 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

This is a short check of server-side resources used by Add Category to Pages
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0162.09 ▲8.80
Dashboard /wp-admin3.42 ▲0.0134.83 ▼1.05
Posts /wp-admin/edit.php3.65 ▲0.0136.37 ▼49.05
Add New Post /wp-admin/post-new.php6.91 ▼0.0697.06 ▼1,185.67
Media Library /wp-admin/upload.php3.31 ▲0.0125.07 ▼2.74
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=page3.3023.59
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=page3.3067.55

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 1 new option
New WordPress options
category_children

Browser metrics Passed 4 tests

Add Category to Pages: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,805 ▲5115.64 ▼0.066.67 ▲0.442.52 ▼0.24
Dashboard /wp-admin2,902 ▲486.12 ▲0.01121.92 ▼18.97158.36 ▼7.19
Posts /wp-admin/edit.php2,698 ▲43.23 ▲0.0063.00 ▼2.34144.96 ▼6.64
Add New Post /wp-admin/post-new.php1,717 ▲621.55 ▲0.70447.12 ▼6.11197.64 ▲27.57
Media Library /wp-admin/upload.php1,708 ▲105.45 ▼0.07168.83 ▲24.55200.37 ▲13.20
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=page1,7152.7655.39162.74
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=page1,8862.7757.50141.79

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • category_children

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > 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 | This is a shallow check for browser errors
Everything seems fine on the user side

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
Please fix the following attributes:
  • Screenshots: Screenshot #1 (Page Edit Screen) image required
The official readme.txt is a good inspiration

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

The primary PHP file in "Add Category to Pages" version 1.2 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same 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 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were 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 very shot review of cyclomatic complexity and code structure
No complexity issues detected
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

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