10% sweepstakes-app

Code Review | Sweepstakes app

WordPress plugin Sweepstakes app scored10%from 54 tests.

About plugin

  • Plugin page: sweepstakes-app
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-3.4.1
  • WordPress version: 6.3.1
  • First release: Apr 14, 2013
  • Latest release: Mar 10, 2014
  • Number of updates: 16
  • Update frequency: every 20.6 days
  • Top authors: alitaj (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,371 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Warning in wp-content/plugins/sweepstakes-app/socialsweepstakes.php+15
    include_once(wp-content/plugins/sweepstakes-app/sweepstakes_widget.php): failed to open stream: No such file or directory

Server metrics [RAM: ▼1.96MB] [CPU: ▼54.56ms] Passed 4 tests

A check of server-side resources used by Sweepstakes app
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.41 ▼36.29
Dashboard /wp-admin2.05 ▼1.265.57 ▼46.03
Posts /wp-admin/edit.php2.05 ▼1.315.31 ▼42.95
Add New Post /wp-admin/post-new.php2.05 ▼3.845.17 ▼92.95
Media Library /wp-admin/upload.php2.05 ▼1.185.02 ▼26.63
Social Sweepstakes /wp-admin/options-general.php?page=sweepstakes-app-options2.055.64

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Sweepstakes app: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲10613.66 ▼0.745.17 ▲3.3158.67 ▲20.07
Dashboard /wp-admin2,219 ▲315.83 ▲0.9599.53 ▼11.8940.09 ▲0.09
Posts /wp-admin/edit.php2,108 ▲192.05 ▼0.0138.85 ▼0.8033.64 ▼2.61
Add New Post /wp-admin/post-new.php1,533 ▲1423.21 ▼0.02656.51 ▼3.2759.75 ▲9.91
Media Library /wp-admin/upload.php1,404 ▲224.23 ▼0.0496.13 ▼0.3945.60 ▲2.44
Social Sweepstakes /wp-admin/options-general.php?page=sweepstakes-app-options7921.8725.8923.36

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
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/sweepstakes-app/socialsweepstakes.php+15
    include_once(wp-content/plugins/sweepstakes-app/sweepstakes_widget.php): failed to open stream: No such file or directory
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=sweepstakes-app-options
    • > Warning in wp-content/plugins/sweepstakes-app/socialsweepstakes.php+15
    include_once(wp-content/plugins/sweepstakes-app/sweepstakes_widget.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/options-general.php?page=sweepstakes-app-options
    • > Warning in wp-content/plugins/sweepstakes-app/socialsweepstakes.php+15
    include_once(): Failed opening 'wp-content/plugins/sweepstakes-app/sweepstakes_widget.php' for inclusion (include_path='.:/usr/share/php')

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
Please fix the following items
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      include_once(): Failed opening 'wp-content/plugins/sweepstakes-app/sweepstakes_widget.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/sweepstakes-app/socialsweepstakes.php on line 15
    • > PHP Warning
      include_once(wp-content/plugins/sweepstakes-app/sweepstakes_widget.php): failed to open stream: No such file or directory in wp-content/plugins/sweepstakes-app/socialsweepstakes.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/sweepstakes-app/common.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/sweepstakes-app/common.php:25

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=sweepstakes-app-options
    • > Security (severe) in unknown
    security - Refused to frame 'https://www.wishpond.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'".

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Tags: There are too many tags (16 tag instead of maximum 10)
The official readme.txt is a good inspiration

sweepstakes-app/socialsweepstakes.php 85% from 13 tests

"Sweepstakes app" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("sweepstakes-app.php" instead of "socialsweepstakes.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 205 characters long)

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
Success! There were no dangerous files found in this plugin105 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP22026105

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
8 PNG files occupy 3.14MB with 2.26MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png1,141.91KB309.21KB▼ 72.92%
screenshot-6.png340.00KB90.60KB▼ 73.35%
screenshot-7.png532.52KB135.95KB▼ 74.47%
screenshot-2.png165.05KB48.78KB▼ 70.44%
screenshot-4.png232.09KB70.51KB▼ 69.62%