62% giveaways-contests

Code Review | Contests & Giveaways - WordPress Contest Plugin

WordPress plugin Contests & Giveaways - WordPress Contest Plugin scored62%from 54 tests.

About plugin

  • Plugin page: giveaways-contests
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.7
  • WordPress version: 6.3.1
  • First release: Dec 15, 2016
  • Latest release: Jul 19, 2018
  • Number of updates: 17
  • Update frequency: every 33.8 days
  • Top authors: davidhme (94.12%)fatcatapps (11.76%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /6,059 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.20MB] [CPU: ▼11.06ms] Passed 4 tests

Analyzing server-side resources used by Contests & Giveaways - WordPress Contest Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2142.25 ▼0.19
Dashboard /wp-admin3.51 ▲0.1746.09 ▼16.13
Posts /wp-admin/edit.php3.62 ▲0.2746.25 ▼1.74
Add New Post /wp-admin/post-new.php6.09 ▲0.2083.58 ▼26.17
Media Library /wp-admin/upload.php3.43 ▲0.2138.92 ▲5.19
Entries /wp-admin/admin.php?page=contest-cat-entries3.3733.49
All Contests /wp-admin/edit.php?post_type=contest3.4737.20
Add New /wp-admin/post-new.php?post_type=contest3.5348.04

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 42 new files
Database: 1 new table, 6 new options
New tables
wp_fca_cc_activity_tbl
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Contests & Giveaways - WordPress Contest Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,858 ▲8713.17 ▼1.182.10 ▲0.1944.53 ▲1.18
Dashboard /wp-admin2,233 ▲455.87 ▼0.05101.78 ▼5.8377.72 ▲34.41
Posts /wp-admin/edit.php2,122 ▲332.01 ▼0.0037.05 ▼3.3331.03 ▼2.30
Add New Post /wp-admin/post-new.php1,693 ▲16022.53 ▼0.54746.28 ▲110.6961.31 ▲2.96
Media Library /wp-admin/upload.php1,418 ▲364.25 ▲0.02115.62 ▲11.1251.15 ▲7.27
Entries /wp-admin/admin.php?page=contest-cat-entries8312.0424.5419.98
All Contests /wp-admin/edit.php?post_type=contest1,0821.9431.8232.22
Add New /wp-admin/post-new.php?post_type=contest2,6727.89169.03132.16

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_fca_cc_activity_tbl
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

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
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=contest-cat-entries
    • > Notice in wp-content/plugins/giveaways-contests/includes/entries/entries.php+38
    Undefined index: id

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/giveaways-contests/languages/index.php
    • > /wp-content/plugins/giveaways-contests/contest-cat.php
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/giveaways-contests/includes/entries/entries.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/giveaways-contests/includes/editor/editor.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/giveaways-contests/includes/contest/contest.php:102
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/giveaways-contests/includes/api.php:47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/giveaways-contests/includes/upgrade.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/giveaways-contests/includes/editor/sidebar.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/giveaways-contests/includes/db.php:201

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (The contest landing page), #2 (The contest signup page), #3 (The Contest Cat settings screen)
Please take inspiration from this readme.txt

giveaways-contests/contest-cat.php 85% from 13 tests

"Contests & Giveaways - WordPress Contest Plugin" version 1.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("giveaways-contests.php" instead of "contest-cat.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 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
Good job! No executable or dangerous file extensions detected1,534 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP932984934
JavaScript108837332
CSS12425266
Markdown1002

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions55
▷ Named functions55100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.31MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon.png0.73KB0.60KB▼ 17.38%
screenshot-1.png70.48KB37.83KB▼ 46.33%
assets/contestcat_icon256_256_360.png62.18KB16.95KB▼ 72.75%
assets/fatcatapps-logo-text.png16.24KB4.88KB▼ 69.97%
screenshot-3.png133.82KB66.59KB▼ 50.24%