72% scratch-win-giveaways-for-website-facebook

Code Review | Scratch & Win - Giveaways and Contests. Boost subscribers, traffic, repeat visits, referrals, sales and more

WordPress plugin Scratch & Win - Giveaways and Contests. Boost subscribers, traffic, repeat visits, referrals, sales and more scored72%from 54 tests.

About plugin

  • Plugin page: scratch-win-givea...
  • Plugin version: 2.6.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.4
  • WordPress version: 6.3.1
  • First release: Sep 9, 2016
  • Latest release: Nov 15, 2023
  • Number of updates: 127
  • Update frequency: every 21.8 days
  • Top authors: akashmalik (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

400+ active /23,485 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼6.10ms] Passed 4 tests

A check of server-side resources used by Scratch & Win - Giveaways and Contests. Boost subscribers, traffic, repeat visits, referrals, sales and more
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1936.29 ▼6.89
Dashboard /wp-admin3.50 ▲0.1546.80 ▼12.10
Posts /wp-admin/edit.php3.61 ▲0.2547.55 ▼1.38
Add New Post /wp-admin/post-new.php6.10 ▲0.2187.25 ▼4.04
Media Library /wp-admin/upload.php3.42 ▲0.1934.31 ▲2.48
Scratch & Win Appsmav /wp-admin/options-general.php?page=appsmavscratchwin3.4034.82

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 36 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
apmswn_register
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Scratch & Win - Giveaways and Contests. Boost subscribers, traffic, repeat visits, referrals, sales and more
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲4714.21 ▲0.351.70 ▼0.0239.32 ▼7.22
Dashboard /wp-admin2,199 ▲245.60 ▲0.0090.30 ▼11.5543.14 ▲3.46
Posts /wp-admin/edit.php2,104 ▲41.96 ▲0.0139.05 ▼1.7837.12 ▲1.00
Add New Post /wp-admin/post-new.php1,531 ▲523.12 ▼0.27620.33 ▼8.8452.95 ▼11.92
Media Library /wp-admin/upload.php1,401 ▲14.16 ▼0.0399.36 ▼6.4042.75 ▼2.88
Scratch & Win Appsmav /wp-admin/options-general.php?page=appsmavscratchwin1,1858.20145.8196.11

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • apmswn_register

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/scratch-win-giveaways-for-website-facebook/socialscratchwin.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/scratch-win-giveaways-for-website-facebook/templates/settings.php:4

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=appsmavscratchwin
    • > Other (warning) in unknown
    https://cdn.livechatinc.com/widget/static/js/iframe.ac52f503.chunk.js 1 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
    • > GET request to /wp-admin/options-general.php?page=appsmavscratchwin
    • > Other (warning) in unknown
    http://cdn.livechatinc.com/tracking.js 0 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes: You can take inspiration from this readme.txt

scratch-win-giveaways-for-website-facebook/socialscratchwin.php 92% from 13 tests

The entry point to "Scratch & Win - Giveaways and Contests. Boost subscribers, traffic, repeat visits, referrals, sales and more" version 2.6.6 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("scratch-win-giveaways-for-website-facebook.php" instead of "socialscratchwin.php")

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
No dangerous file extensions were detected2,756 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP4233771,141
JavaScript22782691,095
CSS34140520

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity76.50
▷ Minimum class complexity53.00
▷ Maximum class complexity100.00
Average method complexity5.72
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods32
▷ Static methods515.62%
▷ Public methods3093.75%
▷ Protected methods26.25%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
6 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icon-link.png1.26KB0.35KB▼ 71.95%
img/tick-green.png1.11KB0.35KB▼ 68.64%
img/Video.png0.62KB0.63KB0.00%
img/appsmav-logo.png5.23KB2.71KB▼ 48.20%
img/icon-error.png1.36KB0.78KB▼ 43.12%