74% text-toggle

Code Review | Text Toggle

WordPress plugin Text Toggle scored74%from 54 tests.

About plugin

  • Plugin page: text-toggle
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9.2-4.3
  • WordPress version: 6.3.1
  • First release: Sep 16, 2015
  • Latest release: Sep 28, 2015
  • Number of updates: 6
  • Update frequency: every 3.2 days
  • Top authors: HoosierDragon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,882 total downloads

Benchmarks

Plugin footprint 65% 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: ▼1.92MB] [CPU: ▼59.47ms] Passed 4 tests

An overview of server-side resources used by Text Toggle
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.394.54 ▼39.97
Dashboard /wp-admin2.09 ▼1.2110.77 ▼38.92
Posts /wp-admin/edit.php2.09 ▼1.276.21 ▼50.26
Add New Post /wp-admin/post-new.php2.09 ▼3.805.68 ▼108.71
Media Library /wp-admin/upload.php2.09 ▼1.145.46 ▼30.42

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Text Toggle
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.73 ▲0.371.92 ▲0.0642.22 ▲0.80
Dashboard /wp-admin2,198 ▲215.81 ▲0.2491.19 ▲1.2340.43 ▼5.18
Posts /wp-admin/edit.php2,097 ▼62.03 ▲0.0539.78 ▼0.5535.99 ▼1.32
Add New Post /wp-admin/post-new.php1,526 ▼023.69 ▲0.17640.92 ▼45.8554.98 ▼3.56
Media Library /wp-admin/upload.php1,403 ▲64.19 ▲0.0499.22 ▼5.0645.37 ▼3.28

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the avp-texttoggle-js handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Please fix the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/text-toggle/1.1/avp-texttoggle.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/text-toggle/avp-texttoggle.php:35

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

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Default display, all text areas are hidden.), #2 (One text area ("Shipping Clerk") selected / shown), #3 (One text section ("Miscellaneous") selected / shown), #4 (All text area selected / shown)
The official readme.txt might help

text-toggle/avp-texttoggle.php 92% from 13 tests

The principal PHP file in "Text Toggle" v. 1.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("text-toggle.php" instead of "avp-texttoggle.php")

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 plugin310 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP26881205
JavaScript63260
CSS36045

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity13.50
▷ Minimum class complexity12.00
▷ Maximum class complexity15.00
Average method complexity3.08
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
8 PNG files occupy 0.46MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png35.58KB13.34KB▼ 62.51%
1.1/screenshot-4.png112.68KB46.60KB▼ 58.64%
1.1/screenshot-3.png48.67KB20.65KB▼ 57.56%
1.1/screenshot-2.png38.73KB15.34KB▼ 60.39%
1.1/screenshot-1.png35.58KB13.34KB▼ 62.51%