79% single-category-permalink

Code Review | Single Category Permalink

WordPress plugin Single Category Permalink scored79%from 54 tests.

About plugin

  • Plugin page: single-category-p...
  • Plugin version: 2.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8
  • WordPress version: 6.3.1
  • First release: Jul 18, 2011
  • Latest release: Sep 29, 2021
  • Number of updates: 17
  • Update frequency: every 265.1 days
  • Top authors: coffee2code (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

800+ active /26,174 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.58ms] Passed 4 tests

This is a short check of server-side resources used by Single Category Permalink
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0234.29 ▼5.90
Dashboard /wp-admin3.33 ▲0.0244.39 ▼5.25
Posts /wp-admin/edit.php3.38 ▲0.0248.67 ▲2.96
Add New Post /wp-admin/post-new.php5.91 ▲0.0285.73 ▼2.33
Media Library /wp-admin/upload.php3.25 ▲0.0232.56 ▼4.85

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Single Category Permalink
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.26 ▼1.121.69 ▼0.1441.37 ▼1.37
Dashboard /wp-admin2,209 ▲184.87 ▼1.03110.06 ▲11.7239.48 ▼4.72
Posts /wp-admin/edit.php2,092 ▲31.99 ▼0.0539.60 ▲2.4634.36 ▼1.67
Add New Post /wp-admin/post-new.php1,534 ▲2023.02 ▲5.48672.28 ▼28.4557.40 ▼0.06
Media Library /wp-admin/upload.php1,382 ▼94.21 ▲0.0294.73 ▼3.7340.72 ▼4.59

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/single-category-permalink/tests/phpunit/bootstrap.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > 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/single-category-permalink/tests/phpunit/bootstrap.php on line 29
    • > 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/single-category-permalink/tests/phpunit/bootstrap.php on line 29

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 Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: structure, coffee2code, link, permalink, category

single-category-permalink/single-category-permalink.php Passed 13 tests

The main file in "Single Category Permalink" v. 2.5.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
122 characters long description:
Reduce permalinks (category or post) that include entire hierarchy of categories to just having the lowest level category.

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
There were no executable files found in this plugin502 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP4120169298
Markdown3370169
Bourne Shell16221
XML10014

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity9.00
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity1.41
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods39
▷ Static methods615.38%
▷ Public methods3692.31%
▷ Protected methods00.00%
▷ Private methods37.69%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin