84% surge

Code Review | Surge

WordPress plugin Surge scored84%from 54 tests.

About plugin

  • Plugin page: surge
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.3
  • WordPress version: 6.3.1
  • First release: Dec 3, 2021
  • Latest release: Sep 19, 2023
  • Number of updates: 25
  • Update frequency: every 26.3 days
  • Top authors: kovshenin (100%)

Code review

54 tests

User reviews

27 reviews

Install metrics

2,000+ active /21,574 total downloads

Benchmarks

Plugin footprint 82% 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: ▲0.16MB] [CPU: ▼9.63ms] Passed 4 tests

An overview of server-side resources used by Surge
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1436.11 ▼2.01
Dashboard /wp-admin3.48 ▲0.1343.83 ▼13.44
Posts /wp-admin/edit.php3.51 ▲0.1645.51 ▼0.69
Add New Post /wp-admin/post-new.php6.15 ▲0.2773.10 ▼20.48
Media Library /wp-admin/upload.php3.42 ▲0.1931.55 ▼2.60

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

A short overview of filesystem and database impact
It is recommended to fix the following issues
  • You have illegally modified 3 files (4.52KB) outside of "wp-content/plugins/surge/" and "wp-content/uploads/"
    • (modified) wp-config.php
    • (new file) wp-content/cache/surge/flags.json.php
    • (new file) wp-content/advanced-cache.php
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
surge_installed
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Surge
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.19 ▼0.251.66 ▼0.0337.41 ▼2.77
Dashboard /wp-admin2,192 ▲145.52 ▼0.0986.29 ▼14.0141.94 ▲0.50
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0136.69 ▲1.8836.08 ▼2.67
Add New Post /wp-admin/post-new.php1,526 ▼1223.27 ▲0.11681.15 ▲35.9857.85 ▼15.80
Media Library /wp-admin/upload.php1,397 ▼34.18 ▲0.1099.67 ▼19.2843.23 ▼4.05

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
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% 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
  • 21× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/surge/include/advanced-cache.php on line 10
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/surge/include/common.php on line 12
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/surge/include/install.php on line 21
    • > PHP Warning
      include_once(WP_CONTENT_DIR/plugins/surge/include/serve.php): failed to open stream: No such file or directory in wp-content/plugins/surge/include/advanced-cache.php on line 15
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/surge/include/common.php on line 12
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/surge/include/common.php on line 12
    • > PHP Warning
      copy(WP_CONTENT_DIR/advanced-cache.php): failed to open stream: No such file or directory in wp-content/plugins/surge/include/install.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Surge\\is_ssl() in wp-content/plugins/surge/include/common.php:123
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/surge/include/common.php on line 12
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/surge/include/common.php on line 12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: performance, cache, caching

surge/surge.php 92% from 13 tests

The entry point to "Surge" version 1.0.5 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

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
Success! There were no dangerous files found in this plugin684 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP11192194684

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity3.00
▷ Minimum method complexity3.00
▷ Maximum method complexity3.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods1
▷ Static methods00.00%
▷ Public methods1100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions834.78%
▷ Anonymous functions1565.22%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin