73% stax

Code Review | STAX Header Builder

WordPress plugin STAX Header Builder scored73%from 54 tests.

About plugin

  • Plugin page: stax
  • Plugin version: 1.3.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 6.3.1
  • First release: May 4, 2018
  • Latest release: Feb 23, 2022
  • Number of updates: 69
  • Update frequency: every 20.4 days
  • Top authors: seventhqueen (94.2%)staxwp (7.25%)

Code review

54 tests

User reviews

10 reviews

Install metrics

700+ active /36,829 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲1.05MB] [CPU: ▲4.53ms] Passed 4 tests

A check of server-side resources used by STAX Header Builder
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.53 ▲1.0747.31 ▲6.39
Dashboard /wp-admin4.35 ▲1.0555.69 ▲6.65
Posts /wp-admin/edit.php4.42 ▲1.0663.40 ▲9.37
Add New Post /wp-admin/post-new.php6.94 ▲1.0599.69 ▲2.17
Media Library /wp-admin/upload.php4.28 ▲1.0540.45 ▲2.92
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius4.6239.35

Server storage [IO: ▲15.18MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 331 new files
Database: 8 new tables, 12 new options
New tables
wp_stax_columns
wp_stax_templates
wp_stax_components
wp_stax_container_viewport
wp_stax_zones
wp_stax_elements
wp_stax_containers
wp_stax_container_items
New WordPress options
stax-render-status
widget_theysaidso_widget
stax-version
theysaidso_admin_options
widget_recent-posts
fs_gdpr
fs_accounts
can_compress_scripts
fs_active_plugins
fs_debug_mode
...

Browser metrics Passed 4 tests

STAX Header Builder: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,995 ▲20913.57 ▼0.6414.93 ▲12.9528.99 ▼16.67
Dashboard /wp-admin2,225 ▲515.54 ▼0.1583.95 ▼4.2485.89 ▲41.29
Posts /wp-admin/edit.php2,150 ▲502.03 ▲0.0339.63 ▲4.3236.68 ▲2.11
Add New Post /wp-admin/post-new.php1,551 ▲2523.12 ▲0.14693.19 ▲19.7678.17 ▲18.16
Media Library /wp-admin/upload.php1,442 ▲424.14 ▼0.07101.94 ▼4.3477.64 ▲32.01
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,0851.6625.4525.92

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/stax/core/lib/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 10 options
    • fs_gdpr
    • fs_accounts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • fs_active_plugins
    • widget_recent-comments
    • fs_debug_mode

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

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
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant STAX_VERSION - assumed 'STAX_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/stax/core/admin/index.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function home_url() in wp-content/plugins/stax/core/admin/index.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can take inspiration from this readme.txt

stax/index.php 92% from 13 tests

The main PHP script in "STAX Header Builder" version 1.3.6 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("stax.php" instead of "index.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin102,171 lines of code in 229 files:
LanguageFilesBlank linesComment linesLines of code
PHP1699,20219,07162,449
CSS213,5684,54727,962
SVG20009,898
JavaScript173341901,621
Markdown1680214
JSON10027

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity49.01
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.35
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces1
Interfaces4
Traits0
Classes100
▷ Abstract classes22.00%
▷ Concrete classes9898.00%
▷ Final classes00.00%
Methods1,516
▷ Static methods33922.36%
▷ Public methods1,13474.80%
▷ Protected methods342.24%
▷ Private methods34822.96%
Functions201
▷ Named functions9547.26%
▷ Anonymous functions10652.74%
Constants149
▷ Global constants10973.15%
▷ Class constants4026.85%
▷ Public constants40100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
22 PNG files occupy 0.46MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/ps-neutral.png0.08KB0.10KB0.00%
assets/images/x-logo-big@2x.png29.23KB6.01KB▼ 79.44%
assets/images/hoffman.png0.10KB0.11KB0.00%
assets/images/header_template_02.png25.12KB9.18KB▼ 63.46%
assets/images/header_template_01.png16.57KB7.43KB▼ 55.19%