84% replace-third-party-asset-source

Code Review | Replace Asset Source

WordPress plugin Replace Asset Source scored84%from 54 tests.

About plugin

  • Plugin page: replace-third-par...
  • Plugin version: 1.3.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.1-6.1
  • WordPress version: 6.3.1
  • First release: Oct 28, 2021
  • Latest release: Nov 2, 2022
  • Number of updates: 12
  • Update frequency: every 30.8 days
  • Top authors: leej3nn20 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /1,338 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼4.29ms] Passed 4 tests

A check of server-side resources used by Replace Asset Source
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0636.90 ▲1.37
Dashboard /wp-admin3.38 ▲0.0744.44 ▼6.58
Posts /wp-admin/edit.php3.49 ▲0.1345.81 ▼4.33
Add New Post /wp-admin/post-new.php5.96 ▲0.0780.26 ▼3.53
Media Library /wp-admin/upload.php3.30 ▲0.0735.14 ▼2.73
Replace Asset Source /wp-admin/options-general.php?page=replace-third-party-asset-source-setting3.2732.02

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Replace Asset Source
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.14 ▼0.091.72 ▲0.0637.31 ▼2.26
Dashboard /wp-admin2,202 ▲215.58 ▼0.0789.29 ▼9.6439.19 ▼0.67
Posts /wp-admin/edit.php2,104 ▲41.98 ▼0.0438.53 ▲0.9535.59 ▼0.12
Add New Post /wp-admin/post-new.php1,529 ▲323.48 ▲0.33677.86 ▼33.8549.36 ▼22.50
Media Library /wp-admin/upload.php1,404 ▲134.16 ▼0.00104.20 ▼0.5544.81 ▲0.08
Replace Asset Source /wp-admin/options-general.php?page=replace-third-party-asset-source-setting8911.9924.5728.10

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=replace-third-party-asset-source-setting
    • > Notice in wp-content/plugins/replace-third-party-asset-source/admin/class-replace-third-party-asset-source-admin.php+292
    Trying to access array offset on value of type bool

SRP Passed 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 SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
5 plugin tags: script, replace javascript, replace css, style, asset

replace-third-party-asset-source/replace-third-party-asset-source.php 85% from 13 tests

The main PHP script in "Replace Asset Source" version 1.3.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 285 characters long)

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
There were no executable files found in this plugin519 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP10163155391
JavaScript119083
CSS18045

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity9.20
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods35
▷ Static methods25.71%
▷ Public methods2674.29%
▷ Protected methods00.00%
▷ Private methods925.71%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin