78% bonway-static-block-editor

Code Review | Bonway Static Block Editor

WordPress plugin Bonway Static Block Editor scored78%from 54 tests.

About plugin

  • Plugin page: bonway-static-blo...
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.7-5.4.2
  • WordPress version: 6.3.1
  • First release: Dec 21, 2018
  • Latest release: Jul 10, 2020
  • Number of updates: 20
  • Update frequency: every 28.5 days
  • Top authors: bonwayservices (95%)Otto42 (10%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /11,686 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.62MB] [CPU: ▼15.98ms] Passed 4 tests

Server-side resources used by Bonway Static Block Editor
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.0743.21 ▼5.94
Dashboard /wp-admin3.41 ▲0.0752.39 ▼0.03
Posts /wp-admin/edit.php3.52 ▲0.1347.04 ▼4.27
Add New Post /wp-admin/post-new.php3.26 ▼2.6738.53 ▼53.67
Media Library /wp-admin/upload.php3.33 ▲0.0641.52 ▲2.80
Add New /wp-admin/post-new.php?post_type=bonway-static-block3.2637.97
Static Blocks /wp-admin/edit.php?post_type=bonway-static-block3.3838.09

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: 10 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Bonway Static Block Editor
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲3214.35 ▼0.211.85 ▲0.0945.78 ▲0.65
Dashboard /wp-admin2,209 ▲355.59 ▼0.0890.67 ▼6.4772.42 ▲31.86
Posts /wp-admin/edit.php2,126 ▲261.95 ▼0.0535.73 ▼0.0734.41 ▼0.79
Add New Post /wp-admin/post-new.php1,703 ▲17721.91 ▼1.19772.95 ▲76.6950.60 ▲0.63
Media Library /wp-admin/upload.php1,429 ▲264.30 ▲0.10110.97 ▲10.7075.12 ▲31.63
Add New /wp-admin/post-new.php?post_type=bonway-static-block2,2807.53170.19133.59
Static Blocks /wp-admin/edit.php?post_type=bonway-static-block1,1221.9030.2426.19

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/post-new.php?post_type=bonway-static-block
    • > Notice in wp-content/plugins/bonway-static-block-editor/helpers/SbeMetaHelper.php+92
    Undefined index: bonwaysbe-display-title
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=bonway-static-block
    • > Notice in wp-content/plugins/bonway-static-block-editor/helpers/SbeMetaHelper.php+54
    Undefined index: bonwaysbe-content-direction
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=bonway-static-block
    • > Notice in wp-content/plugins/bonway-static-block-editor/helpers/SbeMetaHelper.php+54
    Trying to access array offset on value of type null

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
  • 4× 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/bonway-static-block-editor/helpers/SbeCustomDataHelper.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bonway-static-block-editor/helpers/SbeRenderHelper.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bonway-static-block-editor/helpers/SbeCustomDataHelper.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bonway-static-block-editor/helpers/SbeMetaHelper.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: static blocks, blocks, bonway, editor, static

bonway-static-block-editor/bonway-sbe.php 92% from 13 tests

The entry point to "Bonway Static Block Editor" version 1.1.0 is a PHP file that has certain tags in its header comment area
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 ("bonway-static-block-editor.php" instead of "bonway-sbe.php")

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
Everything looks great! No dangerous files found in this plugin317 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP555144226
CSS17068
JavaScript12122
SVG1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
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%
Functions16
▷ Named functions16100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/bonway_logo_mini.png0.96KB1.11KB0.00%