84% block-widget

Code Review | Block Widget

WordPress plugin Block Widget scored84%from 54 tests.

About plugin

  • Plugin page: block-widget
  • Plugin version: 0.1.1
  • PHP compatiblity: 5.6.27+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.4.2
  • WordPress version: 6.3.1
  • First release: May 21, 2019
  • Latest release: Jun 28, 2020
  • Number of updates: 5
  • Update frequency: every 81.0 days
  • Top authors: MaartenM (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

400+ active /4,554 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
This plugin's installer ran successfully

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

Server-side resources used by Block Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.79 ▼2.36
Dashboard /wp-admin3.33 ▲0.0348.23 ▼4.51
Posts /wp-admin/edit.php3.38 ▲0.0349.98 ▲1.50
Add New Post /wp-admin/post-new.php5.91 ▲0.0391.04 ▼5.16
Media Library /wp-admin/upload.php3.25 ▲0.0336.03 ▼4.34

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
widget_mm_block_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Block Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.41 ▲0.032.17 ▲0.3747.05 ▲7.43
Dashboard /wp-admin2,195 ▲155.66 ▲0.0193.39 ▲5.7640.19 ▼2.69
Posts /wp-admin/edit.php2,103 ▲32.03 ▲0.0441.71 ▼6.1837.83 ▼3.72
Add New Post /wp-admin/post-new.php1,545 ▲1923.27 ▲5.84599.05 ▼93.2053.32 ▲1.45
Media Library /wp-admin/upload.php1,403 ▲34.21 ▼0.0499.89 ▼16.7342.29 ▼5.51

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_mm_block_widget
    • db_upgraded

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 | 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
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/block-widget/includes/block-widget.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mm\\add_action() in wp-content/plugins/block-widget/block-widget.php:40

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (Widget) image not found
You can take inspiration from this readme.txt

block-widget/block-widget.php 92% from 13 tests

"Block Widget" version 0.1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Domain Path: The domain path folder was not found ("/languages")

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
No dangerous file extensions were detected82 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2241482

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png41.99KB12.54KB▼ 70.14%