84% reusable-block-count

Code Review | Reusable Block Count

WordPress plugin Reusable Block Count scored84%from 54 tests.

About plugin

  • Plugin page: reusable-block-count
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.6
  • WordPress version: 6.3.1
  • First release: Jan 15, 2021
  • Latest release: Jan 15, 2021
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: georgestephanis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /475 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
The plugin installed gracefully, with no errors

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

A check of server-side resources used by Reusable Block Count
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.05 ▼9.38
Dashboard /wp-admin3.32 ▲0.0244.93 ▼1.83
Posts /wp-admin/edit.php3.37 ▲0.0248.08 ▲0.33
Add New Post /wp-admin/post-new.php5.90 ▲0.0290.15 ▲1.35
Media Library /wp-admin/upload.php3.24 ▲0.0233.67 ▼0.66
Reusable Blocks /wp-admin/edit.php?post_type=wp_block3.2935.80

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Reusable Block Count
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3313.27 ▼1.034.66 ▲2.3844.22 ▼5.76
Dashboard /wp-admin2,210 ▲194.87 ▼1.03102.08 ▼0.4138.93 ▼0.00
Posts /wp-admin/edit.php2,090 ▲12.02 ▲0.0135.36 ▼1.9331.62 ▼1.50
Add New Post /wp-admin/post-new.php1,540 ▲723.48 ▲0.28669.13 ▲15.3854.38 ▲1.11
Media Library /wp-admin/upload.php1,395 ▲44.30 ▲0.1097.58 ▼1.7443.90 ▲1.43
Reusable Blocks /wp-admin/edit.php?post_type=wp_block1,1376.50159.6228.23

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/reusable-block-count/reusable-block-count.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: blocks, reusable, gutenberg

reusable-block-count/reusable-block-count.php Passed 13 tests

The principal PHP file in "Reusable Block Count" v. 1.0 is loaded by WordPress automatically on each request
96 characters long description:
Display a "Reusable blocks" listing page, and a link to view all posts containing a given block.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin58 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1103858

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.60
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods5100.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
No PNG files were detected