84% smodin-rewriter

Code Review | Smodin Rewriter

WordPress plugin Smodin Rewriter scored84%from 54 tests.

About plugin

  • Plugin page: smodin-rewriter
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.7
  • WordPress version: 6.3.1
  • First release: Jul 7, 2021
  • Latest release: Jul 7, 2021
  • Number of updates: 2
  • Update frequency: every 4.5 days
  • Top authors: smodin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /3,352 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▲1.03ms] Passed 4 tests

Server-side resources used by Smodin Rewriter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0944.98 ▲4.06
Dashboard /wp-admin3.44 ▲0.1346.39 ▼1.50
Posts /wp-admin/edit.php3.49 ▲0.1348.96 ▲2.75
Add New Post /wp-admin/post-new.php5.98 ▲0.0996.96 ▲3.68
Media Library /wp-admin/upload.php3.30 ▲0.0736.00 ▼0.80
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins3.3732.69

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 110 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
smodinrewriter-activated
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Smodin Rewriter: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲10813.63 ▼0.671.88 ▲0.0343.05 ▼1.37
Dashboard /wp-admin2,249 ▲585.87 ▲0.98100.66 ▼5.2244.85 ▲4.23
Posts /wp-admin/edit.php2,140 ▲542.05 ▲0.0141.59 ▲3.3538.10 ▲4.21
Add New Post /wp-admin/post-new.php1,569 ▲3618.68 ▼4.47620.32 ▼45.6348.01 ▼10.83
Media Library /wp-admin/upload.php1,439 ▲514.32 ▲0.0799.40 ▼12.3145.87 ▼3.42
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins9712.0625.4530.84

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 fix the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/smodin-rewriter/lib/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/smodin-rewriter/views/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function includes_url() in wp-content/plugins/smodin-rewriter/views/button.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (How to trigger the rewrite), #2 (Rewrite confirmation), #3 (Rewrite successful)
You can take inspiration from this readme.txt

smodin-rewriter/smodin-rewriter.php 92% from 13 tests

"Smodin Rewriter" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin11,213 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
PO File361,8672,4306,583
PHP116091,8712,296
CSS463841,653
JavaScript34319314
Markdown1580281
XML15049
JSON30037

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity29.62
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity3.98
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods125
▷ Static methods118.80%
▷ Public methods9777.60%
▷ Protected methods2318.40%
▷ Private methods54.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants1062.50%
▷ Class constants637.50%
▷ Public constants6100.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
11 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/lib/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png0.26KB0.09KB▼ 66.79%
assets/css/lib/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png0.32KB0.16KB▼ 50.46%
assets/css/lib/jquery-ui/images/ui-icons_454545_256x240.png6.92KB4.18KB▼ 39.61%
assets/css/lib/jquery-ui/images/ui-icons_222222_256x240.png6.86KB4.18KB▼ 39.05%
assets/css/lib/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png0.38KB0.15KB▼ 61.54%