84% toggle-content

Code Review | Toggle Content

WordPress plugin Toggle Content scored84%from 54 tests.

About plugin

  • Plugin page: toggle-content
  • Plugin version: 1.2.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.1
  • WordPress version: 6.3.1
  • First release: Jul 14, 2020
  • Latest release: Dec 4, 2022
  • Number of updates: 16
  • Update frequency: every 54.6 days
  • Top authors: wpdevteam (62.5%)re_enter_rupok (37.5%)alam789 (12.5%)

Code review

54 tests

User reviews

6 reviews

Install metrics

800+ active /8,177 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.60ms] Passed 4 tests

A check of server-side resources used by Toggle Content
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.19 ▼0.15
Dashboard /wp-admin3.32 ▼0.0244.04 ▼17.08
Posts /wp-admin/edit.php3.44 ▲0.0845.39 ▲0.44
Add New Post /wp-admin/post-new.php5.93 ▲0.0577.83 ▼12.27
Media Library /wp-admin/upload.php3.25 ▲0.0232.58 ▼0.88

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Toggle Content
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.17 ▼0.181.60 ▼0.1037.93 ▼8.13
Dashboard /wp-admin2,198 ▲215.57 ▼0.0789.13 ▼11.3139.13 ▼5.09
Posts /wp-admin/edit.php2,100 ▼01.99 ▲0.0038.60 ▲0.9739.08 ▲2.28
Add New Post /wp-admin/post-new.php1,660 ▲13224.61 ▲1.51654.20 ▼14.1257.76 ▲6.45
Media Library /wp-admin/upload.php1,397 ▼34.21 ▼0.0497.40 ▼15.7640.46 ▼8.21

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

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)
Even though no errors were found, 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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/toggle-content/toggle-content.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration Passed 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
10 plugin tags: switch block, content switch, toggle content, block, editor...

toggle-content/toggle-content.php Passed 13 tests

The principal PHP file in "Toggle Content" v. 1.2.6 is loaded by WordPress automatically on each request
34 characters long description:
Toggle Content block for Gutenberg

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin687 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP10115128576
JavaScript715893
JSON20015
CSS3163

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity24.00
▷ Minimum class complexity1.00
▷ Maximum class complexity49.00
Average method complexity5.04
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes120.00%
Methods26
▷ Static methods1038.46%
▷ Public methods2284.62%
▷ Protected methods00.00%
▷ Private methods415.38%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants3
▷ Global constants3100.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
PNG images were not found in this plugin