84% rewrite-slug-before-publishing-a-post

Code Review | Rewrite slug before publishing a post

WordPress plugin Rewrite slug before publishing a post scored84%from 54 tests.

About plugin

  • Plugin page: rewrite-slug-befo...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.5.2
  • WordPress version: 6.3.1
  • First release: Jun 9, 2016
  • Latest release: Jun 9, 2016
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: balfer (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /912 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼0.74ms] Passed 4 tests

A check of server-side resources used by Rewrite slug before publishing a post
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0148.31 ▲5.24
Dashboard /wp-admin3.31 ▲0.0147.92 ▼1.31
Posts /wp-admin/edit.php3.36 ▲0.0051.80 ▲5.66
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.93 ▼8.97
Media Library /wp-admin/upload.php3.23 ▲0.0037.37 ▲2.07

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Rewrite slug before publishing a post
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.22 ▼0.014.74 ▼0.7742.87 ▼0.85
Dashboard /wp-admin2,203 ▲185.79 ▼0.04100.72 ▼18.4938.00 ▼8.89
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0435.53 ▼1.5831.45 ▼2.32
Add New Post /wp-admin/post-new.php1,514 ▼1917.61 ▼5.59687.78 ▲28.2550.95 ▼1.05
Media Library /wp-admin/upload.php1,388 ▼04.33 ▲0.1393.53 ▼16.0341.58 ▼7.14

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/rewrite-slug-before-publishing-a-post/rewrite.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
2 plugin tags: slugs, rewrite

rewrite-slug-before-publishing-a-post/rewrite.php 92% from 13 tests

The main file in "Rewrite slug before publishing a post" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("rewrite-slug-before-publishing-a-post.php" instead of "rewrite.php")

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
No dangerous file extensions were detected17 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP181417

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 were not PNG files found in your plugin