56% advocate-marketing

Code Review | Wordpress Reviews Plugin

WordPress plugin Wordpress Reviews Plugin scored 56% from 54 tests.

About plugin

  • Plugin page: advocate-marketing
  • Plugin version: 2.0.21
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.7
  • WordPress version: 5.9.2
  • First release: Dec 23, 2016
  • Latest release: Jul 12, 2021
  • Number of updates: 49
  • Update frequency: every 33.9 days
  • Top authors: SwiftCloud (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,743 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼1.38MB] [CPU: ▼330.32ms] Passed 4 tests

Server-side resources used by Wordpress Reviews Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.07 ▼0.4419.25 ▼32.12
Dashboard /wp-admin2.98 ▼0.4215.81 ▼21.13
Posts /wp-admin/edit.php2.98 ▼0.6616.99 ▼20.33
Add New Post /wp-admin/post-new.php2.98 ▼3.9916.38 ▼1,247.68
Media Library /wp-admin/upload.php2.98 ▼0.3115.27 ▼9.53
Categories /wp-admin/edit-tags.php?taxonomy=swift_reviews_category&post_type=swift_reviews2.9917.44
Help / Setup /wp-admin/admin.php?page=swiftreviews_help2.9816.79
All Reviews /wp-admin/edit.php?post_type=swift_reviews2.9816.20
Add Review /wp-admin/post-new.php?post_type=swift_reviews2.9816.67
Sharing /wp-admin/admin.php?page=swiftreviews_sharing2.9818.43
Updates & Tips /wp-admin/admin.php?page=swiftreviews_dashboard2.9816.28
Export /wp-admin/admin.php?page=swiftreviews_export2.9818.01
Settings /wp-admin/admin.php?page=swift-reviews2.9816.87
Email Swipes /wp-admin/admin.php?page=swiftreviews_email_swipes2.9820.26
Widgets /wp-admin/widgets.php2.9816.41

Server storage [IO: ▲5.47MB] [DB: ▲0.04MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 116 new files
Database: 2 new tables, 19 new options
New tables
wp_sr_referrals
wp_sr_email_swipes_template
New WordPress options
swiftreviews_social_share_default_text
widget_swift_review_latest_reviews
swift_review_mode
syn_twitter
syn_facebook
swiftreviews_license
swiftreviews_auto_publish_negative_reviews
swiftreviews_coupon_discount_html
swiftreviews_photo_video_contest_html
syn_google
...

Browser metrics Passed 4 tests

A check of browser resources used by Wordpress Reviews Plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,139 ▲41716.44 ▲0.6511.08 ▲4.642.52 ▲0.01
Dashboard /wp-admin3,066 ▲2116.26 ▲0.05124.97 ▼13.19196.52 ▲35.21
Posts /wp-admin/edit.php2,847 ▲1533.28 ▲0.0670.37 ▲5.84158.34 ▲18.34
Add New Post /wp-admin/post-new.php1,773 ▲1317.42 ▼5.24410.60 ▼31.86206.41 ▲46.37
Media Library /wp-admin/upload.php1,871 ▲1765.63 ▲0.13127.44 ▼18.26212.35 ▲27.44
Categories /wp-admin/edit-tags.php?taxonomy=swift_reviews_category&post_type=swift_reviews2,5643.2060.54159.99
Help / Setup /wp-admin/admin.php?page=swiftreviews_help1,1952.7657.28143.19
All Reviews /wp-admin/edit.php?post_type=swift_reviews1,5463.1264.01134.76
Add Review /wp-admin/post-new.php?post_type=swift_reviews3,51610.35206.79286.83
Sharing /wp-admin/admin.php?page=swiftreviews_sharing1,1972.5157.20136.58
Updates & Tips /wp-admin/admin.php?page=swiftreviews_dashboard1,6232.8363.10160.78
Export /wp-admin/admin.php?page=swiftreviews_export1,1922.5356.51134.16
Settings /wp-admin/admin.php?page=swift-reviews4,55012.71247.69178.44
Email Swipes /wp-admin/admin.php?page=swiftreviews_email_swipes1,1492.5655.90131.19
Widgets /wp-admin/widgets.php2,63426.34584.25210.43

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/advocate-marketing/admin/section/cpt-swift-reviews.php+67
    array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead
  • Zombie WordPress options were found after uninstall: 18 options
    • swiftreviews_photo_video_contest_html
    • swiftreviews_widget_onoff
    • swiftreviews_feedback_section_html
    • swiftreviews_license
    • swift_reviews_category_children
    • swiftreviews_widget_header_text
    • swiftreviews_social_share_default_text
    • swiftreviews_auto_publish_positive_reviews
    • swiftreviews_coupon_discount_html
    • syn_google
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 25 occurences, only the last one shown
    • > GET request to /wp-admin/widgets.php
    • > Deprecated in wp-content/plugins/advocate-marketing/admin/section/cpt-swift-reviews.php+67
    array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=swiftreviews_dashboard
    • > Warning in wp-content/plugins/advocate-marketing/admin/section/swift_dashboard.php+136
    DOMDocument::loadHTML(): Tag figure invalid in Entity, line: 1
    • > GET request to /wp-admin/admin.php?page=swift-reviews
    • > Notice in wp-content/plugins/advocate-marketing/admin/section/sr_general_settings.php+30
    Undefined variable: get_helpdesk_form_id

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
The following issues need your attention
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/advocate-marketing/admin/section/sr_purls_settings.php
    • > /wp-content/plugins/advocate-marketing/swift-reviews.php
  • 38× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: get_swiftreviews_photo_video_contest_form_id in wp-content/plugins/advocate-marketing/admin/section/sr_photo_contest_settings.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/advocate-marketing/section/swift-reviews-helpdesk.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/advocate-marketing/section/single-swift_reviews.php:5
    • > PHP Notice
      Undefined variable: get_swiftreviews_upsell in wp-content/plugins/advocate-marketing/admin/section/sr_photo_contest_settings.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/advocate-marketing/admin/section/sr_seo_settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advocate-marketing/admin/section/swiftreviews_settings.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_active_sidebar() in wp-content/plugins/advocate-marketing/section/swift-reviews-sidebar.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advocate-marketing/admin/section/swift_dashboard.php:171
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/advocate-marketing/admin/section/sr_corner_widget_settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/advocate-marketing/admin/section/sr_syndication_settings.php:63

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=swift-reviews
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.9.2 1:31592 "jQuery.Deferred exception: Cannot create property 'guid' on number '80'" "TypeError: Cannot create property 'guid' on number '80'\n at Object.add (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.9.2:2:40879)\n at Object.s.event.add (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.9.2:5:7886)\n at HTMLInputElement.\u003Canonymous> (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.9.2:2:40109)\n at Function.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.9.2:2:3003)\n at s.fn.init.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.9.2:2:1481)\n at Ee (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.9.2:2:40085)\n at Ee (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.9.2:2:39812)\n at s.fn.init.on (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.9.2:2:46578)\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=swift-reviews:205:58)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.9.2:2:30038)" undefined
    • > GET request to /wp-admin/admin.php?page=swift-reviews
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=5.9.2 1:40878 Uncaught TypeError: Cannot create property 'guid' on number '80'

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed: You can look at the official readme.txt

advocate-marketing/swift-reviews.php 85% from 13 tests

The main PHP file in "Wordpress Reviews Plugin" ver. 2.0.21 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("advocate-marketing.php" instead of "swift-reviews.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin24,942 lines of code in 78 files:
LanguageFilesBlank linesComment linesLines of code
SVG51012,236
PHP367165325,071
JavaScript176424784,150
CSS161691463,333
HTML400152

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity28.00
▷ Minimum class complexity7.00
▷ Maximum class complexity49.00
Average method complexity7.00
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods111.11%
▷ Public methods888.89%
▷ Protected methods00.00%
▷ Private methods111.11%
Functions91
▷ Named functions9098.90%
▷ Anonymous functions11.10%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.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
15 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/star5.png2.75KB2.06KB▼ 24.90%
images/emoji1.png0.65KB0.58KB▼ 11.54%
images/emoji2.png0.69KB0.61KB▼ 11.25%
shortcode-generator/js/swiftreview.png0.69KB0.53KB▼ 23.59%
images/swiftreview_user_avatar.png1.90KB1.88KB▼ 1.23%