83% reusable-content-blocks

Code Review | Reusable Content Blocks

WordPress plugin Reusable Content Blocks scored83%from 54 tests.

About plugin

  • Plugin page: reusable-content-...
  • Plugin version: 1.1.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.7-6.1
  • WordPress version: 6.3.1
  • First release: Oct 15, 2018
  • Latest release: Jan 30, 2023
  • Number of updates: 38
  • Update frequency: every 41.3 days
  • Top authors: safeerz (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

5,000+ active /21,440 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼2.07ms] Passed 4 tests

Server-side resources used by Reusable Content Blocks
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0745.04 ▲5.32
Dashboard /wp-admin3.37 ▲0.0746.09 ▼4.65
Posts /wp-admin/edit.php3.42 ▲0.0748.91 ▲3.54
Add New Post /wp-admin/post-new.php5.95 ▲0.0783.88 ▼10.66
Media Library /wp-admin/upload.php3.29 ▲0.0738.12 ▲3.49
Add New /wp-admin/post-new.php?post_type=rc_blocks3.4146.55
All Blocks /wp-admin/edit.php?post_type=rc_blocks3.3435.97
Settings /wp-admin/edit.php?post_type=rc_blocks&page=reusablecb-options3.2631.54

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

Browser metrics Passed 4 tests

An overview of browser requirements for Reusable Content Blocks
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲9413.28 ▼1.371.49 ▼0.4439.59 ▼2.41
Dashboard /wp-admin2,239 ▲515.85 ▼0.0399.62 ▼10.1040.60 ▼8.72
Posts /wp-admin/edit.php2,122 ▲332.03 ▲0.0340.69 ▲6.1338.62 ▲0.46
Add New Post /wp-admin/post-new.php1,556 ▲2323.31 ▲0.14629.20 ▼43.6050.02 ▼1.67
Media Library /wp-admin/upload.php1,421 ▲304.24 ▲0.0395.72 ▼6.0642.05 ▼5.84
Add New /wp-admin/post-new.php?post_type=rc_blocks2,1887.57186.0766.51
All Blocks /wp-admin/edit.php?post_type=rc_blocks1,0941.9429.3530.59
Settings /wp-admin/edit.php?post_type=rc_blocks&page=reusablecb-options8842.0323.7133.42

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/reusable-content-blocks/1.1.3/includes/reusablec-block-post-type.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/reusable-content-blocks/includes/options.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/reusable-content-blocks/1.1.2/includes/options.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/reusable-content-blocks/includes/reusablec-block-post-type.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/reusable-content-blocks/1.1.2/includes/reusablec-block-post-type.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/reusable-content-blocks/1.1.3/1.1.2/includes/reusablec-block-post-type.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/reusable-content-blocks/1.1.3/1.1.2/includes/options.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/reusable-content-blocks/1.1.3/includes/options.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: reusable content widget, thecodepoetry, wpbakery global widget, reusable content blocks

reusable-content-blocks/reusablec-block.php 77% from 13 tests

The main file in "Reusable Content Blocks" v. 1.1.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 262 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("reusable-content-blocks.php" instead of "reusablec-block.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin532 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP6193121503
JavaScript14016
CSS11013

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions64
▷ Named functions6093.75%
▷ Anonymous functions46.25%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin