84% rewrite

Code Review | Rewrite

WordPress plugin Rewrite scored84%from 54 tests.

About plugin

  • Plugin page: rewrite
  • Plugin version: 0.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.2-3.5.1
  • WordPress version: 6.3.1
  • First release: May 27, 2013
  • Latest release: May 29, 2013
  • Number of updates: 8
  • Update frequency: every 0.3 days
  • Top authors: takien (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

500+ active /31,317 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼6.54ms] Passed 4 tests

Analyzing server-side resources used by Rewrite
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1244.85 ▲2.01
Dashboard /wp-admin3.42 ▲0.0852.40 ▼14.93
Posts /wp-admin/edit.php3.54 ▲0.1852.39 ▲2.04
Add New Post /wp-admin/post-new.php6.00 ▲0.1288.53 ▼15.29
Media Library /wp-admin/upload.php3.35 ▲0.1240.09 ▲4.49
Option /wp-admin/admin.php?page=rewrite-plugin-option3.2933.04
Rewrite /wp-admin/admin.php?page=rewrite-plugin3.2931.04
About /wp-admin/admin.php?page=rewrite-plugin-about3.2932.24

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
recovery_mode_email_last_sent
db_upgraded

Browser metrics Passed 4 tests

Rewrite: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲10513.20 ▼1.152.28 ▲0.5945.50 ▲4.45
Dashboard /wp-admin2,220 ▲285.83 ▲0.92103.11 ▼8.3374.86 ▲26.40
Posts /wp-admin/edit.php2,112 ▲232.00 ▼0.0237.82 ▼3.6137.32 ▲0.83
Add New Post /wp-admin/post-new.php1,536 ▲1723.02 ▼0.11739.39 ▲122.0554.25 ▼7.68
Media Library /wp-admin/upload.php1,411 ▲204.24 ▲0.07101.08 ▲2.3377.87 ▲31.84
Option /wp-admin/admin.php?page=rewrite-plugin-option7161.6919.2120.28
Rewrite /wp-admin/admin.php?page=rewrite-plugin7161.6919.3420.21
About /wp-admin/admin.php?page=rewrite-plugin-about7161.4810.6721.41

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rewrite-plugin-about
    • > Error in wp-content/plugins/rewrite/options/easy-options.php+171
    Uncaught Error: [] operator not supported for strings in wp-content/plugins/rewrite/options/easy-options.php:171
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): EasyOptions->tab()
    #1 wp-includes/plugin.php(205): WP_Hook->apply_filters()
    #2 wp-content/plugins/rewrite/rewrite.php(245): apply_filters()
    #3 wp-includes/class-wp-hook.php(310): RewritePluginOption->page()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 {main}
    thrown

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

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 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
The official readme.txt is a good inspiration

rewrite/rewrite.php Passed 13 tests

Analyzing the main PHP file in "Rewrite" version 0.2.1
78 characters long description:
URL rewrite management. Edit/add/backup/restore/test rewrite rule in easy way.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin727 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP28457713
JavaScript10014

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity38.50
▷ Minimum class complexity30.00
▷ Maximum class complexity47.00
Average method complexity5.17
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/Cursor_drag_arrow.png0.37KB0.26KB▼ 29.74%
options/images/icon-setting-large.png1.78KB1.44KB▼ 19.16%
options/images/icon-setting-small.png0.80KB0.67KB▼ 16.12%