84% custom-post-type-permalinks

Code Review | Custom Post Type Permalinks

WordPress plugin Custom Post Type Permalinks scored 84% from 54 tests.

About plugin

  • Plugin page: custom-post-type-...
  • Plugin version: 3.5.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3
  • WordPress version: 6.3.1
  • First release: Dec 3, 2011
  • Latest release: Aug 23, 2023
  • Number of updates: 268
  • Update frequency: every 16.0 days
  • Top authors: Toro_Unit (100%)

Code review

54 tests

User reviews

68 reviews

Install metrics

100,000+ active / 1,359,489 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▼1.30ms] Passed 4 tests

A check of server-side resources used by Custom Post Type Permalinks
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2638.18 ▼2.10
Dashboard /wp-admin3.60 ▲0.3045.86 ▼2.80
Posts /wp-admin/edit.php3.65 ▲0.3048.09 ▲1.94
Add New Post /wp-admin/post-new.php6.14 ▲0.2692.02 ▼2.25
Media Library /wp-admin/upload.php3.46 ▲0.2437.16 ▲5.55

Server storage [IO: ▲0.18MB] [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: 27 new files
Database: no new tables, 10 new options
New WordPress options
add_post_type_for_tax
widget_theysaidso_widget
can_compress_scripts
no_taxonomy_structure
cptp_version
widget_recent-posts
queue_flush_rules
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Custom Post Type Permalinks: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,853 ▲11813.34 ▼1.061.78 ▲0.0443.07 ▲0.94
Dashboard /wp-admin2,259 ▲715.06 ▲0.16114.87 ▼2.3443.62 ▲0.12
Posts /wp-admin/edit.php2,141 ▲492.31 ▲0.3044.54 ▲2.1734.27 ▼4.25
Add New Post /wp-admin/post-new.php1,545 ▲2618.48 ▼4.75587.81 ▼61.1434.58 ▼18.42
Media Library /wp-admin/upload.php1,448 ▲604.36 ▲0.1796.67 ▼13.2542.50 ▼4.59

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • add_post_type_for_tax
    • db_upgraded
    • cptp_version
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'CPTP_Module' not found in wp-content/plugins/custom-post-type-permalinks/CPTP/Module/Admin.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CPTP_Module' not found in wp-content/plugins/custom-post-type-permalinks/CPTP/Module/Permalink.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CPTP_Module' not found in wp-content/plugins/custom-post-type-permalinks/CPTP/Module/Rewrite.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CPTP_Module' not found in wp-content/plugins/custom-post-type-permalinks/CPTP/Module/GetArchives.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CPTP_Module' not found in wp-content/plugins/custom-post-type-permalinks/CPTP/Module/FlushRules.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CPTP_Module' not found in wp-content/plugins/custom-post-type-permalinks/CPTP/Module/Option.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'CPTP_Module' not found in wp-content/plugins/custom-post-type-permalinks/CPTP/Module/Setting.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_file_data() in wp-content/plugins/custom-post-type-permalinks/custom-post-type-permalinks.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: link, url, permalink, address, custom post type

custom-post-type-permalinks/custom-post-type-permalinks.php 85% from 13 tests

The main file in "Custom Post Type Permalinks" v. 3.5.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Requires PHP: The required version number must match the one declared in readme.txt ("7.4" instead of "5.6")
  • Requires at least: The required version number must match the one declared in readme.txt ("6.1" instead of "5.2")

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
There were no executable files found in this plugin1,455 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP112596231,066
PO File34672204
YAML2170112
XML11938
Markdown15019
JavaScript15016

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity18.30
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity3.79
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes110.00%
▷ Concrete classes990.00%
▷ Final classes00.00%
Methods63
▷ Static methods2031.75%
▷ Public methods5688.89%
▷ Protected methods00.00%
▷ Private methods711.11%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.07MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png75.79KB75.08KB▼ 0.95%