10% wp-gratify

Code Review | WP Gratify

WordPress plugin WP Gratify scored 10% from 54 tests.

About plugin

  • Plugin page: wp-gratify
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.5
  • WordPress version: 5.9.2
  • First release: Aug 3, 2019
  • Latest release: Oct 6, 2020
  • Number of updates: 13
  • Update frequency: every 33.4 days
  • Top authors: ekanath (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 453 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/wp-gratify/schema/class-wp-grv-schema.php+91
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲3.55MB] [CPU: ▼342.12ms] Passed 4 tests

This is a short check of server-side resources used by WP Gratify
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /7.93 ▲4.4133.23 ▼17.53
Dashboard /wp-admin7.95 ▲4.5423.66 ▼13.09
Posts /wp-admin/edit.php7.95 ▲4.3023.34 ▼74.82
Add New Post /wp-admin/post-new.php7.95 ▲0.9724.15 ▼1,263.02
Media Library /wp-admin/upload.php7.95 ▲4.6523.47 ▼1.47
Settings /wp-admin/admin.php?page=settings-menu7.9527.81
Dashboard /wp-admin/admin.php?page=review_slug7.9524.20
Add New /wp-admin/admin.php?page=add-new-menu7.9527.61
Help /wp-admin/admin.php?page=help-menu7.9523.99
Categories /wp-admin/admin.php?page=category-menu7.9524.49
WP Gratify /wp-admin/admin.php?page=wp-grv7.9523.26
Freemius Debug [v.2.3.0] /wp-admin/admin.php?page=freemius7.9529.55
Upgrade /wp-admin/admin.php?page=wp-grv-upgrade-menu7.9525.32
Reviews /wp-admin/admin.php?page=all_review_menu7.9523.76

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 244 new files
Database: 3 new tables, 7 new options
New tables
wp_wp_grv_category_list_tbl
wp_wp_grv_review_invitation_tbl
wp_wp_grv_gmb_posts_tbl
New WordPress options
fs_active_plugins
gmb_settings
fs_gdpr
fs_accounts
fs_debug_mode
wp_grv_gmb_location_settings
fs_api_cache

Browser metrics Passed 4 tests

Checking browser requirements for WP Gratify
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,457 ▲71318.85 ▲3.1817.86 ▲11.562.25 ▲0.13
Dashboard /wp-admin3,399 ▲5418.23 ▲2.08162.67 ▲21.97196.16 ▲38.85
Posts /wp-admin/edit.php3,220 ▲5295.79 ▲2.5697.52 ▲32.29162.59 ▲16.05
Add New Post /wp-admin/post-new.php2,053 ▲39221.32 ▼0.38436.10 ▼2.66180.84 ▲22.82
Media Library /wp-admin/upload.php2,003 ▲3056.61 ▲1.11121.44 ▼25.26218.68 ▲30.90
Settings /wp-admin/admin.php?page=settings-menu6,80510.48201.04335.63
Dashboard /wp-admin/admin.php?page=review_slug1,9345.52121.59274.87
Add New /wp-admin/admin.php?page=add-new-menu1,8475.2684.55190.17
Help /wp-admin/admin.php?page=help-menu1,6794.9882.64211.24
Categories /wp-admin/admin.php?page=category-menu1,9675.66100.20201.01
WP Gratify /wp-admin/admin.php?page=wp-grv1,7395.0188.85181.63
Freemius Debug [v.2.3.0] /wp-admin/admin.php?page=freemius1,9305.1586.61131.08
Upgrade /wp-admin/admin.php?page=wp-grv-upgrade-menu280.940.0415.31
Reviews /wp-admin/admin.php?page=all_review_menu1,4985.1883.53111.75

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/wp-gratify/schema/class-wp-grv-schema.php+91
    Trying to access array offset on value of type bool
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_wp_grv_review_invitation_tbl
    • wp_wp_grv_gmb_posts_tbl
    • wp_wp_grv_category_list_tbl
  • Zombie WordPress options were found after uninstall: 7 options
    • gmb_settings
    • fs_api_cache
    • fs_gdpr
    • fs_active_plugins
    • wp_grv_gmb_location_settings
    • fs_debug_mode
    • fs_accounts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 203 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=all_review_menu
    • > Notice in wp-content/plugins/wp-gratify/class-wp-gratify-review.php+431
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-gratify/freemius/templates/ajax-loader.php
  • 16× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-gratify/schema/class-wp-grv-schema.php:90
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/wp-gratify/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-gratify/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-gratify/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/wp-gratify/freemius/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-gratify/wp-grv-tbl-operations/class-wp-grv-tbl-operation.php:1129
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-gratify/shortcode/class-wp-gratify-intake-form-ajax.php:213
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-gratify/wp-gratify-business-hours-display.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-gratify/class-wp-gratify-review-meta-box.php:72
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/wp-gratify/freemius/templates/partials/network-activation.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=all_review_menu
    • > Network (severe)
    wp-content/plugins/wp-gratify//assets/css/admin/wp-grv-invitation-style.css?ver=1.0.0 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=settings-menu
    • > Network (severe)
    wp-content/plugins/wp-gratify//assets/css/admin/wp-grv-gmb-add-post-style.css?ver=1.0.0 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=settings-menu
    • > Network (severe)
    wp-content/plugins/wp-gratify//assets/js/admin/wp-grv-gmb-add-post-script.js?ver=1.0.0 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=settings-menu
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=settings-menu 484 The specified value "#000" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=settings-menu
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=settings-menu 492 The specified value "#000" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
    • > GET request to /wp-admin/admin.php?page=settings-menu
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=settings-menu - Access to XMLHttpRequest at 'https://mybusiness.googleapis.com/v4//reviews' from origin '' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    • > GET request to /wp-admin/admin.php?page=settings-menu
    • > Network (severe)
    https://mybusiness.googleapis.com/v4//reviews - Failed to load resource: net::ERR_FAILED
    • > GET request to /wp-admin/admin.php?page=wp-grv-upgrade-menu
    • > Network (severe)
    wp-admin/admin.php?billing_cycle=annual&page=wp-grv-pricing - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add descriptions for screenshots #1, #10, #11, #12, #13, #14, #15, #16, #17, #18, #19, #2, #3, #4, #5, #6, #7, #8, #9 in wp-gratify/assets to your readme.txt
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt might help

wp-gratify/class-wp-gratify-review.php 92% from 13 tests

This is the main PHP file of "WP Gratify" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-gratify.php" instead of "class-wp-gratify-review.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected57,665 lines of code in 182 files:
LanguageFilesBlank linesComment linesLines of code
PHP1247,05016,15535,213
PO File105,7106,91312,558
JavaScript195851,3655,399
CSS281022554,494
SVG1001

PHP code 0% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,609)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 109)
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity75.38
▷ Minimum class complexity1.00
▷ Maximum class complexity2,609.00
Average method complexity4.68
▷ Minimum method complexity1.00
▷ Maximum method complexity109.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes55
▷ Abstract classes23.64%
▷ Concrete classes5396.36%
▷ Final classes00.00%
Methods1,142
▷ Static methods23220.32%
▷ Public methods81171.02%
▷ Protected methods151.31%
▷ Private methods31627.67%
Functions105
▷ Named functions105100.00%
▷ Anonymous functions00.00%
Constants119
▷ Global constants9680.67%
▷ Class constants2319.33%
▷ Public constants23100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
12 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/wp_grv_test.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/wp_grv.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/external/images/sort_desc_disabled.png0.14KB0.25KB0.00%
assets/external/images/sort_both.png0.20KB0.29KB0.00%