78% survey-2-sale

Code Review | Survey-2-Sale

WordPress plugin Survey-2-Sale scored 78% from 54 tests.

About plugin

  • Plugin page: survey-2-sale
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9.1
  • WordPress version: 6.3.1
  • First release: May 23, 2014
  • Latest release: Jun 30, 2014
  • Number of updates: 4
  • Update frequency: every 10.0 days
  • Top authors: tp02ga (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 665 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.48ms] Passed 4 tests

An overview of server-side resources used by Survey-2-Sale
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.41 ▼0.0625.77 ▼15.93
Dashboard /wp-admin3.33 ▲0.0346.24 ▼1.30
Posts /wp-admin/edit.php3.38 ▲0.0248.83 ▼0.97
Add New Post /wp-admin/post-new.php5.91 ▲0.0287.88 ▼11.73
Media Library /wp-admin/upload.php3.26 ▲0.0235.82 ▲1.26
Survey-2-Sale /wp-admin/options-general.php?page=s2s_plugin3.2030.67

Server storage [IO: ▲0.02MB] [DB: ▲0.00MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Survey-2-Sale
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.48 ▲1.121.71 ▼2.9044.08 ▼7.01
Dashboard /wp-admin2,213 ▲254.83 ▼0.04105.50 ▼2.6537.97 ▼11.58
Posts /wp-admin/edit.php2,093 ▲42.01 ▲0.0138.80 ▼1.1235.33 ▼2.51
Add New Post /wp-admin/post-new.php1,536 ▲2223.13 ▲5.49619.84 ▼20.6452.52 ▲7.91
Media Library /wp-admin/upload.php1,395 ▲44.28 ▲0.0496.44 ▼1.2442.32 ▲0.20
Survey-2-Sale /wp-admin/options-general.php?page=s2s_plugin8412.2225.4535.76

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=s2s_plugin
    • > Notice in wp-content/plugins/survey-2-sale/survery2sale.php+65
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=s2s_plugin
    • > Notice in wp-content/plugins/survey-2-sale/survery2sale.php+125
    Undefined index: list_posts

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
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/survey-2-sale/survery2sale.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/survey-2-sale/survey2sale.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (http://dougkeefe.com/wp-content/uploads/2014/05/screenshot1.png) image required
The official readme.txt is a good inspiration

survey-2-sale/survery2sale.php 85% from 13 tests

The primary PHP file in "Survey-2-Sale" version 0.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 181 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("survey-2-sale.php" instead of "survery2sale.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected313 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP25568269
CSS18038
JavaScript1106

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/Survey2Sale-100px.png7.64KB3.42KB▼ 55.23%