84% pearl-header-builder

Code Review | WordPress Header Builder Plugin – Pearl

WordPress plugin WordPress Header Builder Plugin – Pearl scored84%from 54 tests.

About plugin

  • Plugin page: pearl-header-builder
  • Plugin version: 1.3.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Dec 21, 2017
  • Latest release: Aug 15, 2023
  • Number of updates: 53
  • Update frequency: every 39.0 days
  • Top authors: stylemix (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

10,000+ active /178,007 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.12MB] [CPU: ▼5.18ms] Passed 4 tests

This is a short check of server-side resources used by WordPress Header Builder Plugin – Pearl
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1437.58 ▼1.69
Dashboard /wp-admin4.74 ▲1.4346.60 ▼7.04
Posts /wp-admin/edit.php4.85 ▲1.4951.25 ▲2.38
Add New Post /wp-admin/post-new.php7.34 ▲1.4583.11 ▼14.37
Media Library /wp-admin/upload.php4.66 ▲1.4339.91 ▲6.61

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

Browser metrics Passed 4 tests

An overview of browser requirements for WordPress Header Builder Plugin – Pearl
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,903 ▲15713.66 ▼0.547.18 ▲5.3539.44 ▼4.09
Dashboard /wp-admin2,220 ▲405.90 ▲0.91108.74 ▼11.7138.88 ▼8.68
Posts /wp-admin/edit.php2,103 ▲142.06 ▲0.0435.03 ▼2.1837.23 ▲1.44
Add New Post /wp-admin/post-new.php1,531 ▼523.41 ▲0.05676.71 ▲58.8353.03 ▲3.07
Media Library /wp-admin/upload.php1,399 ▲114.25 ▲0.0596.26 ▼7.7140.80 ▼5.98

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pearl-header-builder/hb_templates/main.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pearl-header-builder/frontend/includes.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed: The official readme.txt is a good inspiration

pearl-header-builder/pearl_header_builder.php 92% from 13 tests

The main PHP script in "WordPress Header Builder Plugin – Pearl" version 1.3.6 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("pearl-header-builder.php" instead of "pearl_header_builder.php")

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
There were no executable files found in this plugin53,551 lines of code in 112 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript88,91155039,125
PHP385292367,963
SVG2002,693
CSS102182,364
HTML41204431,393
JSON130013

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity46.00
▷ Minimum class complexity46.00
▷ Maximum class complexity46.00
Average method complexity7.43
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods228.57%
▷ Public methods685.71%
▷ Protected methods00.00%
▷ Private methods114.29%
Functions69
▷ Named functions6898.55%
▷ Anonymous functions11.45%
Constants4
▷ Global constants4100.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
No PNG images were found in this plugin