79% text-replace

Code Review | Text Replace

WordPress plugin Text Replace scored79%from 54 tests.

About plugin

  • Plugin page: text-replace
  • Plugin version: 4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.7
  • WordPress version: 6.3.1
  • First release: Dec 21, 2004
  • Latest release: Jul 12, 2021
  • Number of updates: 24
  • Update frequency: every 252.0 days
  • Top authors: coffee2code (100%)matt (8.33%)

Code review

54 tests

User reviews

18 reviews

Install metrics

4,000+ active /76,880 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
Installer ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▼2.78ms] Passed 4 tests

This is a short check of server-side resources used by Text Replace
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2537.70 ▼1.81
Dashboard /wp-admin3.55 ▲0.2445.93 ▼2.64
Posts /wp-admin/edit.php3.66 ▲0.3049.52 ▲6.11
Add New Post /wp-admin/post-new.php6.13 ▲0.2481.83 ▼12.78
Media Library /wp-admin/upload.php3.47 ▲0.2445.35 ▲10.34
Text Replace /wp-admin/options-general.php?page=text-replace/text-replace.php3.4432.26

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Text Replace
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.34 ▼0.371.61 ▼0.0840.23 ▼1.36
Dashboard /wp-admin2,202 ▲225.62 ▼0.0385.72 ▲0.1037.56 ▼6.01
Posts /wp-admin/edit.php2,115 ▲182.02 ▼0.0139.01 ▲0.3336.77 ▲2.57
Add New Post /wp-admin/post-new.php1,545 ▲1723.10 ▲0.21675.37 ▲12.7550.80 ▼10.50
Media Library /wp-admin/upload.php1,415 ▲184.23 ▲0.01100.32 ▼5.2245.60 ▼0.72
Text Replace /wp-admin/options-general.php?page=text-replace/text-replace.php1,0532.0524.5243.98

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/text-replace/tests/phpunit/bootstrap.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/tests/phpunit/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/text-replace/tests/phpunit/bootstrap.php on line 19
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/tests/phpunit/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/text-replace/tests/phpunit/bootstrap.php on line 19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: coffee2code, replace, shortcut, text, substitution

text-replace/text-replace.php Passed 13 tests

This is the main PHP file of "Text Replace" version 4.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
128 characters long description:
Replace text with other text. Handy for creating shortcuts to common, lengthy, or frequently changing text/HTML, or for smilies.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin2,137 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP64067551,566
Markdown41040536
Bourne Shell16221
XML10014

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity46.25
▷ Minimum class complexity3.00
▷ Maximum class complexity140.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes125.00%
▷ Concrete classes375.00%
▷ Final classes133.33%
Methods154
▷ Static methods117.14%
▷ Public methods13587.66%
▷ Protected methods1912.34%
▷ Private methods00.00%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
c2c_minilogo.png3.49KB1.91KB▼ 45.43%