78% wpex-replace

Code Review | WPEX Replace DB Urls

WordPress plugin WPEX Replace DB Urls scored78%from 54 tests.

About plugin

  • Plugin page: wpex-replace
  • Plugin version: 0.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.4
  • WordPress version: 6.3.1
  • First release: Sep 20, 2013
  • Latest release: Dec 13, 2015
  • Number of updates: 14
  • Update frequency: every 58.7 days
  • Top authors: dstoever (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /6,574 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼9.84ms] Passed 4 tests

This is a short check of server-side resources used by WPEX Replace DB Urls
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0044.60 ▲3.48
Dashboard /wp-admin3.43 ▲0.0550.62 ▼16.82
Posts /wp-admin/edit.php3.55 ▲0.1548.52 ▼4.04
Add New Post /wp-admin/post-new.php6.01 ▲0.0994.41 ▼19.62
Media Library /wp-admin/upload.php3.36 ▲0.0938.45 ▲1.13
Replace Urls /wp-admin/tools.php?page=wpex_replace_string_tool3.3436.18

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

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

Browser metrics Passed 4 tests

WPEX Replace DB Urls: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.35 ▼0.181.86 ▲0.3844.35 ▲4.61
Dashboard /wp-admin2,202 ▲225.59 ▼0.0685.65 ▼5.5940.07 ▲1.62
Posts /wp-admin/edit.php2,104 ▲42.00 ▼0.0135.59 ▼3.5834.00 ▼2.44
Add New Post /wp-admin/post-new.php1,537 ▲1118.31 ▼4.71642.61 ▼26.6563.68 ▲1.13
Media Library /wp-admin/upload.php1,398 ▲14.22 ▼0.0296.96 ▼7.9143.10 ▼0.89
Replace Urls /wp-admin/tools.php?page=wpex_replace_string_tool1,0171.7929.9026.67

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/wpex-replace/init.php
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wpex-replace/replacestring.class.php on line 5
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/wpex-replace/replacestring.class.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpex-replace/admin.php:4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/wpex-replace/replacestring.class.php on line 5

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

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (The menu to wpex replace.), #2 (Instantly scan your database and see which urls are found.)
The official readme.txt might help

wpex-replace/init.php 92% from 13 tests

"WPEX Replace DB Urls" version 0.4.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wpex-replace.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected898 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP4113102599
PO File262136181
JavaScript113877
CSS1756741

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity74.00
▷ Minimum class complexity74.00
▷ Maximum class complexity74.00
Average method complexity4.04
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
15 compressed PNG files occupy 0.11MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/jquery/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB0.00%
css/jquery/images/ui-bg_glass_95_fef1ec_1x400.png0.14KB0.14KB0.00%
css/jquery/images/ui-icons_222222_256x240.png3.71KB4.11KB0.00%
css/jquery/images/ui-bg_flat_75_ffffff_40x100.png0.07KB0.08KB0.00%
screenshot-2.png85.42KB31.09KB▼ 63.60%