74% simple-post-type-permalinks

Code Review | Simple Post Type Permalinks

WordPress plugin Simple Post Type Permalinks scored74%from 54 tests.

About plugin

  • Plugin page: simple-post-type-...
  • Plugin version: 2.0.5
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Apr 2, 2015
  • Latest release: Jun 5, 2019
  • Number of updates: 29
  • Update frequency: every 52.6 days
  • Top authors: Toro_Unit (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

10,000+ active /77,330 total downloads

Benchmarks

Plugin footprint 65% 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.14MB] [CPU: ▼1.56ms] Passed 4 tests

This is a short check of server-side resources used by Simple Post Type Permalinks
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1642.34 ▼0.38
Dashboard /wp-admin3.44 ▲0.1350.92 ▼6.54
Posts /wp-admin/edit.php3.55 ▲0.1951.61 ▲10.28
Add New Post /wp-admin/post-new.php6.02 ▲0.1399.19 ▼1.04
Media Library /wp-admin/upload.php3.36 ▲0.1340.02 ▲1.74

Server storage [IO: ▲0.10MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
These are issues you should consider
  • Illegal file modification found: 1 file (4.00KB) outside of "wp-content/plugins/simple-post-type-permalinks/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 19 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
sptp_queue_flush_rewrite_rules
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Simple Post Type Permalinks
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲2913.24 ▼1.181.87 ▼0.2943.35 ▼1.34
Dashboard /wp-admin2,218 ▲155.76 ▼0.10101.86 ▼17.8740.97 ▼3.07
Posts /wp-admin/edit.php2,103 ▲32.06 ▲0.0140.96 ▼2.2934.81 ▼4.30
Add New Post /wp-admin/post-new.php1,545 ▲1223.39 ▲0.17617.30 ▼15.0945.63 ▼2.09
Media Library /wp-admin/upload.php1,403 ▲64.25 ▲0.0798.07 ▼40.9445.71 ▼4.61

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/simple-post-type-permalinks/includes/Module/Rewrite.php+114
    array_walk() expects parameter 1 to be array, null given
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
Please fix the following items
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'SPTP\\Module\\Module' not found in wp-content/plugins/simple-post-type-permalinks/includes/Module/Rewrite.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'SPTP\\Module\\Module' not found in wp-content/plugins/simple-post-type-permalinks/includes/Module/Permalink.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'SPTP\\Module\\Module' not found in wp-content/plugins/simple-post-type-permalinks/includes/Module/Flusher.php:12
    • > PHP Fatal error
      require(): Failed opening required 'SPTP_PATH/includes/Psr4AutoloaderClass.php' (include_path='.:/usr/share/php') in wp-content/plugins/simple-post-type-permalinks/includes/SPTP.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'SPTP\\Module\\Module' not found in wp-content/plugins/simple-post-type-permalinks/includes/Module/Admin.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'SPTP\\Module\\Module' not found in wp-content/plugins/simple-post-type-permalinks/includes/Module/Option.php:13
    • > PHP Warning
      require(SPTP_PATH/includes/Psr4AutoloaderClass.php): failed to open stream: No such file or directory in wp-content/plugins/simple-post-type-permalinks/includes/SPTP.php on line 5
    • > PHP Warning
      Use of undefined constant SPTP_PATH - assumed 'SPTP_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/simple-post-type-permalinks/includes/SPTP.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/simple-post-type-permalinks/simple-post-type-permalinks.php:21

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

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: custom post type, cms, permalinks, permalink

simple-post-type-permalinks/simple-post-type-permalinks.php Passed 13 tests

The main PHP script in "Simple Post Type Permalinks" version 2.0.5 is automatically included on every request by WordPress
45 characters long description:
Easy to change Permalink of custom post type.

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
Good job! No executable or dangerous file extensions detected715 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP10204285570
Markdown149070
JavaScript115047
JSON10015
XML11313

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity7.75
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes8
▷ Abstract classes112.50%
▷ Concrete classes787.50%
▷ Final classes00.00%
Methods54
▷ Static methods23.70%
▷ Public methods4379.63%
▷ Protected methods23.70%
▷ Private methods916.67%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.07MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png69.83KB15.52KB▼ 77.77%