84% insert-blocks-before-or-after-posts-content

Code Review | Insert Blocks Before or After Posts Content

WordPress plugin Insert Blocks Before or After Posts Content scored84%from 54 tests.

About plugin

  • Plugin page: insert-blocks-bef...
  • Plugin version: 0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.1
  • WordPress version: 6.3.1
  • First release: Dec 3, 2019
  • Latest release: Oct 26, 2022
  • Number of updates: 17
  • Update frequency: every 62.2 days
  • Top authors: audrasjb (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /9,007 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼3.38ms] Passed 4 tests

Analyzing server-side resources used by Insert Blocks Before or After Posts Content
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0636.37 ▼7.57
Dashboard /wp-admin3.37 ▲0.0743.01 ▼6.14
Posts /wp-admin/edit.php3.43 ▲0.0747.43 ▲0.38
Add New Post /wp-admin/post-new.php5.96 ▲0.0793.34 ▼0.20
Media Library /wp-admin/upload.php3.30 ▲0.0633.39 ▲1.34
Before/after content /wp-admin/themes.php?page=insert-blocks-before-or-after-posts-content3.2732.61

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Insert Blocks Before or After Posts Content
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.23 ▼1.171.55 ▼0.2335.72 ▼9.51
Dashboard /wp-admin2,204 ▲335.84 ▼0.2198.76 ▼23.3540.88 ▼4.00
Posts /wp-admin/edit.php2,096 ▲72.04 ▲0.0540.38 ▲2.8435.27 ▲1.27
Add New Post /wp-admin/post-new.php1,536 ▼623.49 ▲5.10597.10 ▼25.3950.43 ▲0.80
Media Library /wp-admin/upload.php1,389 ▲74.30 ▲0.0995.70 ▼9.2543.60 ▼0.26
Before/after content /wp-admin/themes.php?page=insert-blocks-before-or-after-posts-content1,0022.1822.7728.36

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/insert-blocks-before-or-after-posts-content/insert-block-before-after-content.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
9 plugin tags: insert, content, prepend, page, block...

insert-blocks-before-or-after-posts-content/insert-block-before-after-content.php 92% from 13 tests

"Insert Blocks Before or After Posts Content" version 0.3'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:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("insert-blocks-before-or-after-posts-content.php" instead of "insert-block-before-after-content.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected380 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP24339380

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.53
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%
Functions10
▷ Named functions880.00%
▷ Anonymous functions220.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin