84% rewrite-image-url

Code Review | Rewrite Image URL

WordPress plugin Rewrite Image URL scored84%from 54 tests.

About plugin

  • Plugin page: rewrite-image-url
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.4
  • WordPress version: 6.3.1
  • First release: Apr 15, 2020
  • Latest release: Apr 15, 2020
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: salimserdar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /638 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.02MB] [CPU: ▼2.00ms] Passed 4 tests

A check of server-side resources used by Rewrite Image URL
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.45 ▼4.74
Dashboard /wp-admin3.32 ▲0.0242.54 ▼3.79
Posts /wp-admin/edit.php3.37 ▲0.0146.80 ▼0.71
Add New Post /wp-admin/post-new.php5.92 ▲0.0387.83 ▲3.12
Media Library /wp-admin/upload.php3.24 ▲0.0134.01 ▲1.26
Rewrite Img Url /wp-admin/options-general.php?page=rewrite-image-url-option-page3.2130.15

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Rewrite Image URL: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,894 ▲14813.94 ▼0.645.17 ▲3.5242.12 ▼7.51
Dashboard /wp-admin2,217 ▲294.83 ▼1.05100.59 ▼15.1838.95 ▼4.42
Posts /wp-admin/edit.php2,100 ▲112.05 ▲0.0639.57 ▲3.4234.42 ▲1.16
Add New Post /wp-admin/post-new.php1,521 ▼1223.06 ▼0.26627.19 ▼45.3348.95 ▲0.75
Media Library /wp-admin/upload.php1,390 ▼14.18 ▼0.0197.15 ▲1.8141.11 ▼1.30
Rewrite Img Url /wp-admin/options-general.php?page=rewrite-image-url-option-page7832.0623.5525.46

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • 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
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/rewrite-image-url/admin/partials/rewrite-image-url-admin-display.php
    • > /wp-content/plugins/rewrite-image-url/public/partials/rewrite-image-url-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
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 an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: Screenshot #1 (This screen shot description to show how to add your hostname.) image not found
Please take inspiration from this readme.txt

rewrite-image-url/rewrite-image-url.php 92% from 13 tests

The main file in "Rewrite Image URL" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 168 characters long)

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
Success! There were no dangerous files found in this plugin218 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12116537214
JavaScript22274
CSS2080

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.07
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.12
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods26
▷ Static methods27.69%
▷ Public methods2180.77%
▷ Protected methods00.00%
▷ Private methods519.23%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected