72% domain-replace

Code Review | Domain Replace

WordPress plugin Domain Replace scored 72% from 54 tests.

About plugin

  • Plugin page: domain-replace
  • Plugin version: 1.3.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.2
  • WordPress version: 5.9.2
  • First release: Jan 14, 2015
  • Latest release: May 2, 2015
  • Number of updates: 13
  • Update frequency: every 8.3 days
  • Top authors: duogeek (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active / 8,382 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.38MB] [CPU: ▼315.32ms] Passed 4 tests

A check of server-side resources used by Domain Replace
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▼0.0349.50 ▲4.86
Dashboard /wp-admin3.21 ▼0.1920.42 ▼20.27
Posts /wp-admin/edit.php3.28 ▼0.3625.30 ▼13.00
Add New Post /wp-admin/post-new.php6.06 ▼0.9173.15 ▼1,225.81
Media Library /wp-admin/upload.php3.24 ▼0.0520.03 ▼2.18
Help /wp-admin/admin.php?page=duogeek-panel-help3.2019.25
Domain Replace Options /wp-admin/admin.php?page=dr-convert3.2019.88
DuoGeek /wp-admin/admin.php?page=duogeek-panel3.2019.28
Licenses /wp-admin/admin.php?page=duogeek-pro-licenses3.2019.86

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 161 new files
Database: no new tables, 1 new option
New WordPress options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

A check of browser resources used by Domain Replace
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,851 ▲9716.46 ▲0.526.46 ▲0.482.27 ▼0.70
Dashboard /wp-admin2,967 ▲1097.07 ▲0.66119.53 ▼18.61154.49 ▼8.70
Posts /wp-admin/edit.php2,766 ▲783.74 ▲0.3168.28 ▲6.82162.80 ▲21.23
Add New Post /wp-admin/post-new.php1,814 ▲14622.92 ▲2.94402.11 ▲12.80172.47 ▲15.48
Media Library /wp-admin/upload.php1,773 ▲756.12 ▲0.36123.62 ▼32.10190.02 ▼12.51
Help /wp-admin/admin.php?page=duogeek-panel-help1,0233.3156.68100.00
Domain Replace Options /wp-admin/admin.php?page=dr-convert1,5807.91137.59210.04
DuoGeek /wp-admin/admin.php?page=duogeek-panel9722.3539.02109.33
Licenses /wp-admin/admin.php?page=duogeek-pro-licenses1,0413.0457.2286.53

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 1 option
    • recovery_mode_email_last_sent

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=duogeek-pro-licenses
    • > Notice in wp-content/plugins/domain-replace/duogeek/duogeek-panel.php+147
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/admin.php?page=duogeek-panel
    • > Error in wp-content/plugins/domain-replace/duogeek/duogeek-panel.php+413
    Uncaught Error: Cannot use object of type WP_Error as array in wp-content/plugins/domain-replace/duogeek/duogeek-panel.php:413
    Stack trace:
    #0 wp-includes/class-wp-hook.php(307): DuoGeekPlugins->duogeek_panel_cb()
    #1 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(474): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/domain-replace/duogeek/duogeek-panel.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/domain-replace/duogeek/helper.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/domain-replace/domainreplace.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/domain-replace/duogeek/class.customPostType.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=dr-convert
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.9.2 1:31592 "jQuery.Deferred exception: $(...).iCheck is not a function" "TypeError: $(...).iCheck is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/domain-replace/duogeek/inc/duogeek.js?ver=1.1:8:36)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.9.2:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.9.2:2:30340)" undefined
    • > GET request to /wp-admin/admin.php?page=dr-convert
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.9.2 1:31702 Uncaught TypeError: $(...).iCheck is not a function

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: domain change, url change, domain replace, url replace

domain-replace/domainreplace.php 92% from 13 tests

Analyzing the main PHP file in "Domain Replace" version 1.3.8
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("domain-replace.php" instead of "domainreplace.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
Good job! No executable or dangerous file extensions detected16,481 lines of code in 89 files:
LanguageFilesBlank linesComment linesLines of code
CSS548323009,556
JavaScript45489322,728
Sass1326241,352
LESS1326331,343
PHP424172937
SVG100565

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity31.00
▷ Minimum class complexity3.00
▷ Maximum class complexity59.00
Average method complexity3.61
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes150.00%
▷ Concrete classes150.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods1878.26%
▷ Protected methods521.74%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.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
66 compressed PNG files occupy 0.16MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
duogeek/inc/icheck/skins/minimal/aero@2x.png1.38KB2.66KB0.00%
duogeek/inc/icheck/skins/square/aero.png2.12KB1.83KB▼ 13.71%
duogeek/inc/icheck/skins/square/blue@2x.png4.38KB3.04KB▼ 30.61%
duogeek/inc/icheck/skins/flat/orange.png1.48KB1.66KB0.00%
duogeek/inc/icheck/skins/square/aero@2x.png4.35KB3.07KB▼ 29.45%