62% competition-form

Code Review | Competition Form

WordPress plugin Competition Form scored62%from 54 tests.

About plugin

  • Plugin page: competition-form
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.5
  • WordPress version: 6.3.1
  • First release: Mar 6, 2015
  • Latest release: May 12, 2016
  • Number of updates: 30
  • Update frequency: every 14.5 days
  • Top authors: raiserweb (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /4,837 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.55MB] [CPU: ▼0.80ms] Passed 4 tests

A check of server-side resources used by Competition Form
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.03 ▲0.5645.33 ▼4.46
Dashboard /wp-admin3.90 ▲0.5660.88 ▲1.50
Posts /wp-admin/edit.php3.95 ▲0.6059.23 ▲2.93
Add New Post /wp-admin/post-new.php6.42 ▲0.54111.21 ▲2.65
Media Library /wp-admin/upload.php3.76 ▲0.5436.97 ▼2.89
Select Winner /wp-admin/admin.php?page=select_winner3.7335.46
Winners /wp-admin/admin.php?page=winners3.7338.64
Add New /wp-admin/admin.php?page=add_new3.7441.50
Entries /wp-admin/admin.php?page=entries3.7561.11
Install Plugins /wp-admin/themes.php?page=comp-tgmpa-install-plugins3.8333.84
Competitions /wp-admin/admin.php?page=competitions3.7438.12

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 13 new files
Database: 2 new tables, 6 new options
New tables
wp_competition_entries_meta
wp_competition_entries
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Competition Form
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,873 ▲12713.36 ▼1.232.03 ▲0.2148.28 ▲5.23
Dashboard /wp-admin2,276 ▲885.93 ▲0.76128.28 ▲6.3051.00 ▲7.58
Posts /wp-admin/edit.php2,173 ▲872.26 ▲0.2646.28 ▲6.2342.61 ▲0.85
Add New Post /wp-admin/post-new.php1,575 ▲4223.31 ▼0.01638.55 ▼89.9156.28 ▼9.22
Media Library /wp-admin/upload.php1,472 ▲844.39 ▲0.27105.22 ▼13.4345.23 ▼9.13
Select Winner /wp-admin/admin.php?page=select_winner9702.3928.7838.27
Winners /wp-admin/admin.php?page=winners9692.2329.2330.95
Add New /wp-admin/admin.php?page=add_new9312.2129.5133.40
Entries /wp-admin/admin.php?page=entries1,0342.2446.1736.36
Install Plugins /wp-admin/themes.php?page=comp-tgmpa-install-plugins1,0222.2235.2135.25
Competitions /wp-admin/admin.php?page=competitions9602.2228.0131.53

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie tables detected upon uninstall: 2 tables
    • wp_competition_entries_meta
    • wp_competition_entries
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=winners
    • > Notice in wp-content/plugins/competition-form/admin-pages/competition_winners.php+52
    Undefined variable: competition_entries_table
    • > GET request to /wp-admin/admin.php?page=winners
    • > Notice in wp-content/plugins/competition-form/admin-pages/competition_winners.php+52
    Trying to get property 'competition_id' of non-object
    • > GET request to /wp-admin/admin.php?page=winners
    • > Notice in wp-content/plugins/competition-form/admin-pages/competition_winners.php+52
    Trying to get property 'current_page' of non-object

SRP 50% 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
Almost there! Just fix the following items
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/competition-form/required_plugin/class-tgm-plugin-activation.php:1911
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/competition-form/class/table_classes.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'competition_form_plugin' not found in wp-content/plugins/competition-form/admin-pages/competition_select_winner.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/competition-form/functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/competition-form/required_plugin/class-tgm-plugin-activation.php:1911
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/competition-form/class/table_classes.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/competition-form/class/table_classes.php on line 5

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=select_winner
    • > Network (severe)
    wp-content/plugins/competition-form/assets/css/images/ui-bg_flat_75_ffffff_40x100.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: competition, competition form, competition entry form

competition-form/competition-form.php 92% from 13 tests

Analyzing the main PHP file in "Competition Form" version 2.0
Please make the necessary changes and fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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 plugin2,749 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP119521,5922,748
CSS1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity30.91
▷ Minimum class complexity1.00
▷ Maximum class complexity178.00
Average method complexity3.63
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods125
▷ Static methods54.00%
▷ Public methods10483.20%
▷ Protected methods2016.00%
▷ Private methods10.80%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin