79% peer-categories

Code Review | Peer Categories

WordPress plugin Peer Categories scored79%from 54 tests.

About plugin

  • Plugin page: peer-categories
  • Plugin version: 2.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Jun 12, 2009
  • Latest release: Aug 22, 2023
  • Number of updates: 24
  • Update frequency: every 216.6 days
  • Top authors: coffee2code (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /6,263 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
Installer ran successfully

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

This is a short check of server-side resources used by Peer Categories
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0235.07 ▼7.55
Dashboard /wp-admin3.33 ▼0.0249.62 ▼17.15
Posts /wp-admin/edit.php3.38 ▲0.0248.65 ▼3.56
Add New Post /wp-admin/post-new.php5.92 ▲0.0291.08 ▼16.16
Media Library /wp-admin/upload.php3.26 ▲0.0235.84 ▼1.30

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Peer Categories
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.51 ▲0.141.84 ▲0.0542.10 ▼4.73
Dashboard /wp-admin2,195 ▲185.61 ▼0.0482.92 ▼9.0440.34 ▼4.69
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0740.24 ▲0.4534.76 ▼0.02
Add New Post /wp-admin/post-new.php1,528 ▼722.88 ▲4.78657.32 ▼18.0252.26 ▼6.16
Media Library /wp-admin/upload.php1,400 ▼34.21 ▲0.0996.96 ▼3.8543.97 ▼3.31

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% 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
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/peer-categories/tests/phpunit/bootstrap.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/tests/phpunit/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/peer-categories/tests/phpunit/bootstrap.php on line 29
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/tests/phpunit/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/peer-categories/tests/phpunit/bootstrap.php on line 29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

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
5 plugin tags: the_category, sibling, coffee2code, related posts, category

peer-categories/peer-categories.php Passed 13 tests

The entry point to "Peer Categories" version 2.2.1 is a PHP file that has certain tags in its header comment area
135 characters long description:
List the categories that are peer (i.e. share the same category parent) to all lowest-level assigned categories for the specified post.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected654 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP4127127368
Markdown4870251
Bourne Shell16221
XML10014

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity1.57
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods1676.19%
▷ Protected methods00.00%
▷ Private methods523.81%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin