84% toggles

Code Review | Toggles

WordPress plugin Toggles scored84%from 54 tests.

About plugin

  • Plugin page: toggles
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.2
  • WordPress version: 6.3.1
  • First release: Feb 8, 2021
  • Latest release: Jun 17, 2023
  • Number of updates: 4
  • Update frequency: every 215.5 days
  • Top authors: Mamaduka (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /5,719 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
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.29ms] Passed 4 tests

Analyzing server-side resources used by Toggles
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.91 ▼3.91
Dashboard /wp-admin3.32 ▲0.0244.13 ▼6.55
Posts /wp-admin/edit.php3.37 ▲0.0145.00 ▼1.28
Add New Post /wp-admin/post-new.php5.90 ▲0.0280.21 ▼12.33
Media Library /wp-admin/upload.php3.24 ▲0.0132.73 ▼2.38

Server storage [IO: ▲0.02MB] [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: 7 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Toggles
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.17 ▼1.582.06 ▲0.1040.55 ▼3.38
Dashboard /wp-admin2,206 ▲185.88 ▲0.79107.83 ▲2.0736.10 ▼0.69
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0140.00 ▲2.7233.89 ▲0.07
Add New Post /wp-admin/post-new.php6,352 ▲4,83827.70 ▲10.23878.65 ▲200.5856.51 ▼1.19
Media Library /wp-admin/upload.php1,388 ▼04.15 ▼0.0494.11 ▼14.6840.62 ▼6.02

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
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Mamaduka\\Toggles\\add_action() in wp-content/plugins/toggles/toggles.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

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: accordion, faq, block, details, blocks

toggles/toggles.php Passed 13 tests

The principal PHP file in "Toggles" v. 1.1.0 is loaded by WordPress automatically on each request
39 characters long description:
An easy way to hide and reveal content.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected66 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JSON10057
PHP22177
CSS1001
JavaScript1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.00
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
Namespaces1
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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