90% wp-select-primary-category

Code Review | WP Select Primary Category

WordPress plugin WP Select Primary Category scored90%from 54 tests.

About plugin

  • Plugin page: wp-select-primary...
  • Plugin version: 1.0.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Dec 23, 2019
  • Latest release: Dec 27, 2019
  • Number of updates: 4
  • Update frequency: every 111.8 days
  • Top authors: mobeen-abdullah (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

70+ active /1,272 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: ▼9.00ms] Passed 4 tests

An overview of server-side resources used by WP Select Primary Category
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0137.62 ▲0.55
Dashboard /wp-admin3.32 ▼0.0245.33 ▼16.24
Posts /wp-admin/edit.php3.37 ▲0.0143.55 ▼4.98
Add New Post /wp-admin/post-new.php5.91 ▲0.0280.61 ▼13.27
Media Library /wp-admin/upload.php3.25 ▲0.0132.66 ▼1.50

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by WP Select Primary Category
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.60 ▼0.831.66 ▼0.1041.09 ▼6.59
Dashboard /wp-admin2,209 ▲235.86 ▲0.9695.14 ▼21.7140.26 ▼5.09
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0533.16 ▼0.4534.87 ▼1.31
Add New Post /wp-admin/post-new.php6,239 ▲4,71726.03 ▲2.98916.93 ▲260.4180.45 ▲31.98
Media Library /wp-admin/upload.php1,391 ▼04.17 ▼0.0495.40 ▼4.5641.96 ▼0.61

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests Passed 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 Passed 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
No output text or server-side errors detected on direct access of PHP files

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 issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: primary category, taxonomies, category

wp-select-primary-category/wp-select-primary-category.php Passed 13 tests

The main PHP script in "WP Select Primary Category" version 1.0.8 is automatically included on every request by WordPress
80 characters long description:
Custom plugin to select primary category to show content based on that categroy.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected156 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP4298979
Bourne Shell1242968
Dockerfile1207
Markdown1002

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity5.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 constants1100.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
PNG images were not found in this plugin