78% contests-from-rewards-fuel

Code Review | Contests by Rewards Fuel

WordPress plugin Contests by Rewards Fuel scored78%from 54 tests.

About plugin

  • Plugin page: contests-from-rew...
  • Plugin version: 2.0.62
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: Aug 28, 2015
  • Latest release: Aug 28, 2023
  • Number of updates: 384
  • Update frequency: every 7.6 days
  • Top authors: RewardsFuel (100%)

Code review

54 tests

User reviews

65 reviews

Install metrics

100+ active /51,671 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▼4.25ms] Passed 4 tests

This is a short check of server-side resources used by Contests by Rewards Fuel
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1344.25 ▲3.13
Dashboard /wp-admin3.44 ▲0.1355.31 ▼2.18
Posts /wp-admin/edit.php3.55 ▲0.1949.69 ▼9.35
Add New Post /wp-admin/post-new.php6.03 ▲0.1487.35 ▼8.60
Media Library /wp-admin/upload.php3.36 ▲0.1343.91 ▲10.45
Rewards Fuel /wp-admin/admin.php?page=rewards_fuel_contests3.3334.36
Contest editor /wp-admin/admin.php?page=rewards_fuel_contest_editor3.3630.54
Your account /wp-admin/admin.php?page=rewards_fuel_account3.3344.83

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 59 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
rewards_fuel_api_key
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Contests by Rewards Fuel
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,914 ▲15313.69 ▼0.728.28 ▲6.6643.91 ▲0.26
Dashboard /wp-admin2,236 ▲595.63 ▲0.0388.44 ▼4.2643.10 ▼4.38
Posts /wp-admin/edit.php2,144 ▲411.96 ▼0.0235.79 ▼9.1037.42 ▼1.09
Add New Post /wp-admin/post-new.php6,293 ▲4,76525.94 ▲3.06926.27 ▲248.0474.27 ▲12.61
Media Library /wp-admin/upload.php1,444 ▲444.23 ▼0.02104.11 ▼6.4044.81 ▼5.90
Rewards Fuel /wp-admin/admin.php?page=rewards_fuel_contests1,6333.2378.0783.30
Contest editor /wp-admin/admin.php?page=rewards_fuel_contest_editor5,87714.51634.60218.63
Your account /wp-admin/admin.php?page=rewards_fuel_account1,3612.8045.3557.89

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • rewards_fuel_api_key
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 18× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/contests-from-rewards-fuel/admin/views/welcome.php
    • > /wp-content/plugins/contests-from-rewards-fuel/admin/views/editor_views/embed_area.php
    • > /wp-content/plugins/contests-from-rewards-fuel/admin/views/editor_views/prize_controls.php
    • > /wp-content/plugins/contests-from-rewards-fuel/admin/views/editor_views/settings_general.php
    • > /wp-content/plugins/contests-from-rewards-fuel/admin/views/legacy_box.php
    • > /wp-content/plugins/contests-from-rewards-fuel/admin/views/upgrade.php
    • > /wp-content/plugins/contests-from-rewards-fuel/admin/views/editor_views/prize_form.php
    • > /wp-content/plugins/contests-from-rewards-fuel/admin/views/editor_views/settings_schedule.php
    • > /wp-content/plugins/contests-from-rewards-fuel/public/partials/contests-from-rewards-fuel-public-display.php
    • > /wp-content/plugins/contests-from-rewards-fuel/admin/views/editor_views/contestants_report.php
  • 17× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: rf_key in wp-content/plugins/contests-from-rewards-fuel/admin/views/contest_editor.php on line 7
    • > PHP Notice
      Undefined variable: rf_key in wp-content/plugins/contests-from-rewards-fuel/admin/views/account_page_logged_in.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Class_rf' not found in wp-content/plugins/contests-from-rewards-fuel/includes/class-contests-from-rewards-fuel-i18n.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Class_rf' not found in wp-content/plugins/contests-from-rewards-fuel/includes/class-contests-from-rewards-fuel.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Class_rf' not found in wp-content/plugins/contests-from-rewards-fuel/includes/class-contests-from-rewards-fuel-loader.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_site_url() in wp-content/plugins/contests-from-rewards-fuel/admin/views/account_page_logged_in.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Class_rf' not found in wp-content/plugins/contests-from-rewards-fuel/includes/class-contests-from-rewards-fuel-activator.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Class_rf' not found in wp-content/plugins/contests-from-rewards-fuel/includes/class-contests-from-rewards-fuel-admin.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Class_rf' not found in wp-content/plugins/contests-from-rewards-fuel/includes/class-contests-from-rewards-fuel-deactivator.php:23
    • > PHP Notice
      Undefined variable: rf_key in wp-content/plugins/contests-from-rewards-fuel/admin/views/dashboard.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% 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 your attention:
  • Tags: You are using too many tags: 63 tag instead of maximum 10
  • Screenshots: Screenshot #1 (Customize the style to look perfect.) image not found
Please take inspiration from this readme.txt

contests-from-rewards-fuel/contests-from-rewards-fuel.php Passed 13 tests

"Contests by Rewards Fuel" version 2.0.62's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
57 characters long description:
Run contests which add incentive for subscribing and more

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected8,019 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript73461755,069
PHP342174831,778
CSS57146930
SVG721242

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity10.11
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity2.49
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods57
▷ Static methods1119.30%
▷ Public methods4273.68%
▷ Protected methods00.00%
▷ Private methods1526.32%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin