94% toggle-media

Code Review | Toggle Media

WordPress plugin Toggle Media scored 94% from 54 tests.

About plugin

  • Plugin page: toggle-media
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.0
  • WordPress version: 5.9.2
  • First release: Sep 16, 2014
  • Latest release: Sep 17, 2014
  • Number of updates: 3
  • Update frequency: every 1.0 days
  • Top authors: wptipsntricks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,610 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

A check of server-side resources used by Toggle Media
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0152.47 ▲4.28
Dashboard /wp-admin3.42 ▲0.0133.99 ▲0.68
Posts /wp-admin/edit.php3.65 ▲0.0137.91 ▼0.18
Add New Post /wp-admin/post-new.php6.90 ▼0.0894.13 ▼1,224.64
Media Library /wp-admin/upload.php3.30 ▼0.0025.43 ▼5.11

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Toggle Media
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,872 ▲11816.33 ▲0.769.23 ▲2.882.08 ▼0.12
Dashboard /wp-admin2,895 ▲376.13 ▼0.01117.72 ▼23.44158.10 ▼3.32
Posts /wp-admin/edit.php2,694 ▲33.23 ▼0.0163.23 ▼1.23144.17 ▼2.72
Add New Post /wp-admin/post-new.php1,661 ▼715.72 ▼2.50422.40 ▲3.64155.35 ▼2.20
Media Library /wp-admin/upload.php1,698 ▼05.46 ▼0.08147.81 ▲4.92188.18 ▼1.99

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

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 | 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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/toggle-media/toggle-media.php:11

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

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 29 tag instead of maximum 10
Please take inspiration from this readme.txt

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

The primary PHP file in "Toggle Media" version 1.0.1 is used by WordPress to initiate all plugin functionality
55 characters long description:
Allows you to toggle media when a text/image is clicked

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin39 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP141039

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin