10% greenstory-for-woocommerce

Code Review | GreenStory for WooCommerce

WordPress plugin GreenStory for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: greenstory-for-wo...
  • Plugin version: 1.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.6.0
  • WordPress version: 6.3.1
  • First release: Aug 29, 2019
  • Latest release: Sep 20, 2021
  • Number of updates: 12
  • Update frequency: every 63.3 days
  • Top authors: greenstorydemo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /661 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/greenstory-for-woocommerce/gs-index.php+22
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.97MB] [CPU: ▼58.23ms] Passed 4 tests

An overview of server-side resources used by GreenStory for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.68 ▼39.65
Dashboard /wp-admin2.05 ▼1.305.96 ▼53.36
Posts /wp-admin/edit.php2.05 ▼1.315.35 ▼41.59
Add New Post /wp-admin/post-new.php2.05 ▼3.845.53 ▼98.30
Media Library /wp-admin/upload.php2.05 ▼1.185.93 ▼25.63

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

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

Browser metrics Passed 4 tests

Checking browser requirements for GreenStory for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲5513.20 ▼1.101.87 ▼0.3541.98 ▼0.46
Dashboard /wp-admin2,232 ▲474.97 ▲0.07102.52 ▼6.6972.24 ▲32.51
Posts /wp-admin/edit.php2,115 ▲261.97 ▼0.0437.83 ▼3.4834.15 ▼1.63
Add New Post /wp-admin/post-new.php1,542 ▼023.09 ▲4.95730.47 ▲128.5264.06 ▲7.85
Media Library /wp-admin/upload.php1,413 ▲254.14 ▼0.1194.76 ▼19.7172.94 ▲28.96

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
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/greenstory-for-woocommerce/gs-index.php+22
    Trying to access array offset on value of type bool
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/greenstory-for-woocommerce/includes/gs-plugin.scripts.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/greenstory-for-woocommerce/includes/gs-plugin.class.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Plugin Name: Please specify the plugin name on the first line ( === greenstory-for-woocommerce === )
  • Screenshots: These screenshots lack descriptions #1, #2, #3, #4 in greenstory-for-woocommerce/assets to your readme.txt
The official readme.txt is a good inspiration

greenstory-for-woocommerce/gs-index.php 92% from 13 tests

"GreenStory for WooCommerce" version 1.5.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("greenstory-for-woocommerce.php" instead of "gs-index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected1,510 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP62541261,491
JavaScript13019

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity198.00
▷ Minimum class complexity198.00
▷ Maximum class complexity198.00
Average method complexity5.69
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods42
▷ Static methods00.00%
▷ Public methods42100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions37
▷ Named functions37100.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 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
includes/gs-logo.png0.55KB0.48KB▼ 12.39%