78% staticwp

Code Review | StaticWP

WordPress plugin StaticWP scored 78% from 54 tests.

About plugin

  • Plugin page: staticwp
  • Plugin version: 1.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.1
  • WordPress version: 6.3.1
  • First release: Mar 4, 2015
  • Latest release: Apr 26, 2015
  • Number of updates: 8
  • Update frequency: every 6.6 days
  • Top authors: slogsdon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,613 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼3.69ms] Passed 4 tests

Analyzing server-side resources used by StaticWP
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0841.45 ▲0.30
Dashboard /wp-admin3.38 ▲0.0754.73 ▼4.14
Posts /wp-admin/edit.php3.50 ▲0.1449.23 ▼2.01
Add New Post /wp-admin/post-new.php5.97 ▲0.0789.95 ▼8.92
Media Library /wp-admin/upload.php3.31 ▲0.0742.89 ▲7.60
StaticWP /wp-admin/tools.php?page=staticwp3.2934.79

Server storage [IO: ▲0.02MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Please fix the following
  • Illegal file modification found: 1 file (0.32KB) outside of "wp-content/plugins/staticwp/" and "wp-content/uploads/"
    • (new file) wp-content/mu-plugins/staticwp-mu.php
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
staticwpversion

Browser metrics Passed 4 tests

StaticWP: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲2214.48 ▲1.261.77 ▲0.1143.95 ▼3.72
Dashboard /wp-admin2,210 ▲45.86 ▲1.0098.81 ▼10.8937.59 ▼6.67
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0440.53 ▲4.0433.88 ▼1.39
Add New Post /wp-admin/post-new.php1,545 ▼018.32 ▼0.23609.99 ▼35.2555.14 ▲8.93
Media Library /wp-admin/upload.php1,395 ▲104.18 ▼0.0298.78 ▲2.2445.15 ▲2.41
StaticWP /wp-admin/tools.php?page=staticwp7972.1824.3628.07

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/staticwp/templates/admin/preload-error.notice.php
    • > /wp-content/plugins/staticwp/templates/admin/preload-success.notice.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'StaticWP\\Admin' not found in wp-content/plugins/staticwp/templates/admin/menu.include.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'StaticWP\\View' not found in wp-content/plugins/staticwp/templates/admin/info.page.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'StaticWP\\View' not found in wp-content/plugins/staticwp/templates/admin/preload.page.php:5

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
2 plugin tags: cache, static

staticwp/staticwp.php Passed 13 tests

The primary PHP file in "StaticWP" version 1.5.0 is used by WordPress to initiate all plugin functionality
38 characters long description:
Converts your blog into a static site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin498 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP975226376
Markdown1810103
JSON10019

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity12.33
▷ Minimum class complexity2.00
▷ Maximum class complexity25.00
Average method complexity2.48
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods23
▷ Static methods626.09%
▷ Public methods1878.26%
▷ Protected methods521.74%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin