72% staatic

Code Review | Staatic - Static Site Generator

WordPress plugin Staatic - Static Site Generator scored72%from 54 tests.

About plugin

  • Plugin page: staatic
  • Plugin version: 1.6.3
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Jun 18, 2021
  • Latest release: Nov 8, 2023
  • Number of updates: 63
  • Update frequency: every 13.9 days
  • Top authors: staatic (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active /15,857 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲4.26MB] [CPU: ▲22.80ms] Passed 4 tests

Analyzing server-side resources used by Staatic - Static Site Generator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /7.59 ▲4.1263.35 ▲18.61
Dashboard /wp-admin7.61 ▲4.3070.48 ▲19.38
Posts /wp-admin/edit.php7.66 ▲4.3078.04 ▲36.03
Add New Post /wp-admin/post-new.php10.20 ▲4.31107.66 ▲17.19
Media Library /wp-admin/upload.php7.54 ▲4.3068.10 ▲37.14
/wp-admin/admin.php?page=staatic-publication-results7.3254.22
Settings /wp-admin/admin.php?page=staatic-settings7.5754.02
/wp-admin/admin.php?page=staatic-publication-logs7.3247.34
/wp-admin/admin.php?page=staatic-publication-logs-export7.3261.74
/wp-admin/admin.php?page=staatic-test-request7.51102.32
Staatic /wp-admin/admin.php?page=staatic7.3249.54
/wp-admin/admin.php?page=staatic-publication-download7.3249.36
/wp-admin/admin.php?page=staatic-publication-delete7.3253.81
/wp-admin/admin.php?page=staatic-publish7.4654.43
/wp-admin/admin.php?page=staatic-publication7.3246.67

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 1,487 new files
Database: 8 new tables, 12 new options
New tables
wp_staatic_publications
wp_staatic_crawl_queue
wp_staatic_known_urls
wp_staatic_deployments
wp_staatic_log_entries
wp_staatic_results
wp_staatic_results_deployment
wp_staatic_builds
New WordPress options
staatic_database_version
staatic_current_publication_id
staatic_active_publication_id
can_compress_scripts
widget_recent-posts
staatic_test_request_status
db_upgraded
staatic_active_preview_publication_id
staatic_latest_publication_id
theysaidso_admin_options
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Staatic - Static Site Generator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,996 ▲24915.91 ▲1.681.73 ▲0.0138.33 ▼5.11
Dashboard /wp-admin2,383 ▲2037.45 ▲1.80208.79 ▲114.7442.78 ▲3.19
Posts /wp-admin/edit.php2,228 ▲1286.25 ▲4.2964.78 ▲27.6835.34 ▼0.37
Add New Post /wp-admin/post-new.php1,724 ▲19821.80 ▼1.45591.59 ▼12.9938.15 ▼16.13
Media Library /wp-admin/upload.php1,531 ▲1378.25 ▲4.11113.58 ▲10.4340.36 ▼2.08
/wp-admin/admin.php?page=staatic-publication-results280.410.123.73
Settings /wp-admin/admin.php?page=staatic-settings1,0815.8054.8629.97
/wp-admin/admin.php?page=staatic-publication-logs280.410.104.09
/wp-admin/admin.php?page=staatic-publication-logs-export280.410.083.56
/wp-admin/admin.php?page=staatic-test-request9285.8847.7727.13
Staatic /wp-admin/admin.php?page=staatic280.410.073.57
/wp-admin/admin.php?page=staatic-publication-download280.410.113.86
/wp-admin/admin.php?page=staatic-publication-delete280.410.073.69
/wp-admin/admin.php?page=staatic-publish8036.2134.2819.64
/wp-admin/admin.php?page=staatic-publication280.410.062.96

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/staatic/vendor/masterminds/html5/bin/entities.php
  • 881× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Staatic\\WordPress\\Module\\ModuleInterface' not found in wp-content/plugins/staatic/src/Module/Admin/ExtendSiteHealth.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Staatic\\Vendor\\Symfony\\Component\\DependencyInjection\\Loader\\FileLoader' not found in wp-content/plugins/staatic/vendor/symfony/dependency-injection/Loader/XmlFileLoader.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Staatic\\Vendor\\Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/staatic/vendor/guzzlehttp/psr7/src/FnStream.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Staatic\\Vendor\\Ramsey\\Uuid\\Builder\\UuidBuilderInterface' not found in wp-content/plugins/staatic/vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Staatic\\Vendor\\Symfony\\Component\\DependencyInjection\\Compiler\\CompilerPassInterface' not found in wp-content/plugins/staatic/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Staatic\\WordPress\\Migrations\\AbstractMigration' not found in wp-content/plugins/staatic/migrations/v1.0.3-5-delete-stale-deployment-results.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Staatic\\WordPress\\Setting\\AbstractSetting' not found in wp-content/plugins/staatic/src/Module/Deployer/FilesystemDeployer/RetainPathsSetting.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Staatic\\WordPress\\Migrations\\AbstractMigration' not found in wp-content/plugins/staatic/migrations/v1.4.4-beta3-create-index-on-results-sha1.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Staatic\\Vendor\\Symfony\\Component\\DependencyInjection\\LazyProxy\\Instantiator\\InstantiatorInterface' not found in wp-content/plugins/staatic/vendor/symfony/dependency-injection/LazyProxy/Instantiator/LazyServiceInstantiator.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Staatic\\Vendor\\Ramsey\\Collection\\AbstractSet' not found in wp-content/plugins/staatic/vendor/ramsey/collection/src/Set.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=staatic-publication-results
    • > Network (severe)
    wp-admin/admin.php?page=staatic-publication-results - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=staatic-publication-logs
    • > Network (severe)
    wp-admin/admin.php?page=staatic-publication-logs - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=staatic-publication-logs-export
    • > Network (severe)
    wp-admin/admin.php?page=staatic-publication-logs-export - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=staatic
    • > Network (severe)
    wp-admin/admin.php?page=staatic - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=staatic-publication-download
    • > Network (severe)
    wp-admin/admin.php?page=staatic-publication-download - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=staatic-publication-delete
    • > Network (severe)
    wp-admin/admin.php?page=staatic-publication-delete - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=staatic-publication
    • > Network (severe)
    wp-admin/admin.php?page=staatic-publication - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration Passed 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
10 plugin tags: static site, security, fast, cdn, caching...

staatic/staatic.php Passed 13 tests

This is the main PHP file of "Staatic - Static Site Generator" version 1.6.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
102 characters long description:
Staatic for WordPress allows you to generate a highly optimized static version of your WordPress site.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected96,710 lines of code in 1,440 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,4265,58115,62392,236
JSON4003,170
PO File1391583737
XSD1331362
Bourne Shell12311147
Markdown24038
make14014
YAML1003
CSS1001
JavaScript1001
SVG1001

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 methods should be reduced to less than 100 (currently 111)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity10.96
▷ Minimum class complexity1.00
▷ Maximum class complexity624.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity111.00
Code structure
Namespaces215
Interfaces192
Traits61
Classes1,110
▷ Abstract classes423.78%
▷ Concrete classes1,06896.22%
▷ Final classes52048.69%
Methods8,183
▷ Static methods7719.42%
▷ Public methods6,83683.54%
▷ Protected methods5236.39%
▷ Private methods82410.07%
Functions680
▷ Named functions20730.44%
▷ Anonymous functions47369.56%
Constants659
▷ Global constants192.88%
▷ Class constants64097.12%
▷ Public constants51580.47%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin