84% reusable-text-blocks

Code Review | Reusable Text Blocks

WordPress plugin Reusable Text Blocks scored84%from 54 tests.

About plugin

  • Plugin page: reusable-text-blocks
  • Plugin version: 1.5.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.7
  • WordPress version: 6.3.1
  • First release: Dec 19, 2012
  • Latest release: Mar 30, 2021
  • Number of updates: 55
  • Update frequency: every 55.0 days
  • Top authors: halgatewood (100%)

Code review

54 tests

User reviews

36 reviews

Install metrics

9,000+ active /65,992 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
Install script ran successfully

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

This is a short check of server-side resources used by Reusable Text Blocks
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0440.81 ▼12.97
Dashboard /wp-admin3.34 ▲0.0350.33 ▼7.51
Posts /wp-admin/edit.php3.39 ▲0.0349.72 ▼1.41
Add New Post /wp-admin/post-new.php5.92 ▲0.0399.41 ▼13.04
Media Library /wp-admin/upload.php3.26 ▲0.0342.01 ▲7.56
All Text Blocks /wp-admin/edit.php?post_type=text-blocks3.3040.01
Add New /wp-admin/post-new.php?post_type=text-blocks3.3848.57

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
widget_textblockswidget
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Reusable Text Blocks
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲8614.24 ▼0.061.74 ▼0.1140.58 ▼4.08
Dashboard /wp-admin2,222 ▲455.65 ▼0.0190.64 ▼1.1940.63 ▲0.37
Posts /wp-admin/edit.php2,130 ▲272.04 ▲0.0639.01 ▼3.0335.17 ▼0.16
Add New Post /wp-admin/post-new.php1,571 ▲3523.76 ▲5.63675.50 ▲54.9456.43 ▼5.48
Media Library /wp-admin/upload.php1,430 ▲304.16 ▼0.05101.21 ▼4.9145.44 ▼0.15
All Text Blocks /wp-admin/edit.php?post_type=text-blocks1,0852.0734.4730.67
Add New /wp-admin/post-new.php?post_type=text-blocks2,1787.57170.0968.41

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
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_textblockswidget
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/reusable-text-blocks/text-blocks.php:30

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
9 plugin tags: widget, text blocks, reusable text, content blocks, reusable content...

reusable-text-blocks/text-blocks.php 85% from 13 tests

This is the main PHP file of "Reusable Text Blocks" version 1.5.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("reusable-text-blocks.php" instead of "text-blocks.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin280 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP17448280

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
menu-icon.png0.63KB1.20KB0.00%
icon-32.png0.54KB0.48KB▼ 10.38%