62% no-frills-prize-draw

Code Review | No Frills Prize Draw Competitions

WordPress plugin No Frills Prize Draw Competitionsscored62%from 54 tests.

About plugin

  • Plugin page: no-frills-prize-draw
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2
  • WordPress version: 6.3.1
  • First release: Nov 17, 2015
  • Latest release: Nov 17, 2019
  • Number of updates: 96
  • Update frequency: every 15.2 days
  • Top authors: jtibbles (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

70+ active /5,089 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼9.17ms] Passed 4 tests

An overview of server-side resources used by No Frills Prize Draw Competitions
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.06 ▼5.23
Dashboard /wp-admin3.34 ▼0.0152.84 ▼10.80
Posts /wp-admin/edit.php3.43 ▲0.0753.03 ▼0.75
Add New Post /wp-admin/post-new.php5.90 ▲0.0288.14 ▼19.90
Media Library /wp-admin/upload.php3.24 ▲0.0237.22 ▼0.29
Prize Draw Details /wp-admin/admin.php?page=nfpd_prize_draw3.3533.89
Shortcode /wp-admin/admin.php?page=nfpd_shortcode_generator3.2838.60
Select Prize Draw CSV /wp-admin/admin.php?page=nfpd_prize_draw_export3.2437.11
Select Prize Draw Winner /wp-admin/admin.php?page=nfpd_pick_winner3.2133.02
View Prize Draw Entries /wp-admin/admin.php?page=nfpd_prize_draw_view_draw_entries3.3630.82

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 18 new files
Database: 2 new tables, 6 new options
New tables
wp_nfpd_entries
wp_nfpd
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by No Frills Prize Draw Competitions
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,978 ▲23214.45 ▼0.112.19 ▲0.4742.92 ▼0.52
Dashboard /wp-admin2,356 ▲1766.18 ▲0.59107.40 ▲18.3138.23 ▼9.94
Posts /wp-admin/edit.php2,290 ▲1903.32 ▲1.3348.26 ▲8.0529.22 ▼6.26
Add New Post /wp-admin/post-new.php1,548 ▲2223.45 ▼0.25662.76 ▼39.7436.97 ▼17.19
Media Library /wp-admin/upload.php1,424 ▲274.17 ▲0.0687.34 ▼25.6444.28 ▼1.37
Prize Draw Details /wp-admin/admin.php?page=nfpd_prize_draw1,3363.0245.6669.18
Shortcode /wp-admin/admin.php?page=nfpd_shortcode_generator1,1163.1538.0333.70
Select Prize Draw CSV /wp-admin/admin.php?page=nfpd_prize_draw_export1,0012.9738.1324.82
Select Prize Draw Winner /wp-admin/admin.php?page=nfpd_pick_winner7071.5010.6120.82
View Prize Draw Entries /wp-admin/admin.php?page=nfpd_prize_draw_view_draw_entries1,1862.9937.4941.69

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
  • Zombie tables detected upon uninstall: 2 tables
    • wp_nfpd
    • wp_nfpd_entries
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-edit-draw-admin.php+24
    Undefined index: edited
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-edit-draw-admin.php+44
    Trying to get property 'thumb' of non-object
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw_view_draw_entries
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-view-entrees-admin.php+46
    Trying to get property '_winner' of non-object
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-edit-draw-admin.php+48
    Trying to get property 'nam' of non-object
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-edit-draw-admin.php+49
    Trying to get property '_registered' of non-object
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-edit-draw-admin.php+51
    Trying to get property '_pp_link' of non-object
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-edit-draw-admin.php+53
    Trying to get property '_terms_link' of non-object
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-edit-draw-admin.php+56
    Trying to get property 'descr' of non-object
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-edit-draw-admin.php+58
    Trying to get property '_type' of non-object
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-edit-draw-admin.php+60
    Trying to get property '_question' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw_view_draw_entries
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-view-entrees-admin.php+48
    Trying to get property '_answer' of non-object
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-edit-draw-admin.php+67
    Trying to get property '_answers' of non-object
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-edit-draw-admin.php+72
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-edit-draw-admin.php+80
    Trying to get property 'id' of non-object
    • > GET request to /wp-admin/admin.php?page=nfpd_pick_winner
    • > Notice in wp-content/plugins/no-frills-prize-draw/no-frills-prize-draw.php+544
    Undefined index: custom_main_nonce
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw_view_draw_entries
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-view-entrees-admin.php+26
    Undefined index: picked
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw_view_draw_entries
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-view-entrees-admin.php+45
    Trying to get property '_prize_name' of non-object
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw_view_draw_entries
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-view-entrees-admin.php+47
    Trying to get property '_amended' of non-object
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw_view_draw_entries
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-view-entrees-admin.php+84
    Undefined index: paged
    • > GET request to /wp-admin/admin.php?page=nfpd_prize_draw_view_draw_entries
    • > Notice in wp-content/plugins/no-frills-prize-draw/admin/nfpd-view-entrees-admin.php+105
    Undefined index: filter

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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/no-frills-prize-draw/no-frills-prize-draw.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/no-frills-prize-draw/admin/nfpd-shortcode-generator-admin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/no-frills-prize-draw/admin/nfpd-view-entrees-admin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/no-frills-prize-draw/admin/nfpd-edit-draw-admin.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% 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
Please fix the following attributes:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === No Frills Prize Draw Competitions=== )
  • Contributors: Plugin contributors field is missing
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

no-frills-prize-draw/no-frills-prize-draw.php 92% from 13 tests

The main PHP file in "No Frills Prize Draw Competitions" ver. 1.2.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 302 characters long)

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
Everything looks great! No dangerous files found in this plugin1,715 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP433968918
PO File1131172311
CSS270283
JavaScript37617203

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/questionmark.png1.07KB0.97KB▼ 9.36%