84% responsive-block-swap

Code Review | Responsive Block Visibility Swap

WordPress plugin Responsive Block Visibility Swap scored84%from 54 tests.

About plugin

  • Plugin page: responsive-block-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.2
  • WordPress version: 6.3.1
  • First release: Jun 17, 2023
  • Latest release: Jul 2, 2023
  • Number of updates: 5
  • Update frequency: every 3.2 days
  • Top authors: mizan42047 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /90 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.74ms] Passed 4 tests

Server-side resources used by Responsive Block Visibility Swap
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.45 ▼6.16
Dashboard /wp-admin3.33 ▲0.0351.55 ▼1.63
Posts /wp-admin/edit.php3.38 ▲0.0350.58 ▲1.15
Add New Post /wp-admin/post-new.php5.91 ▲0.0388.69 ▼16.32
Media Library /wp-admin/upload.php3.25 ▲0.0338.12 ▲2.68

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

Browser metrics Passed 4 tests

Responsive Block Visibility Swap: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.40 ▼0.981.78 ▲0.1443.38 ▼3.13
Dashboard /wp-admin2,203 ▲185.83 ▼0.0399.63 ▼5.3241.11 ▼0.07
Posts /wp-admin/edit.php2,089 ▼01.98 ▲0.0140.68 ▲3.5236.91 ▲3.36
Add New Post /wp-admin/post-new.php1,524 ▲1017.54 ▼0.16637.85 ▼12.2246.28 ▼26.40
Media Library /wp-admin/upload.php1,388 ▲34.21 ▲0.0194.63 ▼6.0643.50 ▼7.74

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-posts
    • responsive_block_swap_installed_time
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • responsive_block_swap_version
    • db_upgraded
    • widget_theysaidso_widget

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/responsive-block-swap/responsive-block-swap.php:100

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: gutenberg, responsive, visibility, hide, block...

responsive-block-swap/responsive-block-swap.php Passed 13 tests

"Responsive Block Visibility Swap" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
91 characters long description:
Easily hide and show Gutenberg blocks based on screen size for a responsive website layout.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin70 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2182568
CSS1001
JavaScript1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods10
▷ Static methods110.00%
▷ Public methods990.00%
▷ Protected methods00.00%
▷ Private methods110.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants375.00%
▷ Class constants125.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
PNG images were not found in this plugin