84% wpreplace

Code Review | WPReplace内容字符替换插件

WordPress plugin WPReplace内容字符替换插件 scored84%from 54 tests.

About plugin

  • Plugin page: wpreplace
  • Plugin version: 6.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-6.2
  • WordPress version: 6.3.1
  • First release: Sep 3, 2019
  • Latest release: May 13, 2023
  • Number of updates: 20
  • Update frequency: every 67.4 days
  • Top authors: laobuluo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

2,000+ active /15,093 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.02MB] [CPU: ▼5.67ms] Passed 4 tests

This is a short check of server-side resources used by WPReplace内容字符替换插件
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.96 ▲1.97
Dashboard /wp-admin3.33 ▼0.0155.73 ▼9.41
Posts /wp-admin/edit.php3.38 ▲0.0350.58 ▲1.12
Add New Post /wp-admin/post-new.php5.91 ▲0.0397.86 ▼16.37
Media Library /wp-admin/upload.php3.26 ▲0.0337.50 ▲3.91
WPRelace设置 /wp-admin/tools.php?page=wpreplace/index.php3.2232.09

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

WPReplace内容字符替换插件: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.37 ▲0.081.74 ▲0.0938.12 ▼5.76
Dashboard /wp-admin2,199 ▲255.62 ▼0.0490.37 ▲5.5844.51 ▲4.32
Posts /wp-admin/edit.php2,101 ▼22.03 ▲0.0039.47 ▼6.6441.71 ▲3.17
Add New Post /wp-admin/post-new.php1,540 ▲1118.18 ▼4.81651.35 ▲29.1569.79 ▲24.36
Media Library /wp-admin/upload.php1,407 ▲74.22 ▲0.03101.29 ▼4.3250.27 ▲3.44
WPRelace设置 /wp-admin/tools.php?page=wpreplace/index.php1,1022.1332.96103.27

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpreplace/index.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
1 plugin tags: wordpress

wpreplace/index.php 92% from 13 tests

Analyzing the main PHP file in "WPReplace内容字符替换插件" version 6.2
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wpreplace.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin417 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP13314207
SVG13563195
JavaScript6059
CSS6046

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.28MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
layui/images/logo.png25.43KB0.87KB▼ 96.58%
layui/css/modules/layer/default/icon.png11.22KB4.36KB▼ 61.19%
screenshot-1.png146.01KB20.03KB▼ 86.28%
layui/css/modules/layer/default/icon-ext.png5.77KB2.91KB▼ 49.62%
layui/images/footer_logo.png24.74KB0.87KB▼ 96.48%