63% contest-code-checker

Code Review | Run Contests, Raffles, and Giveaways with ContestsWP

WordPress plugin Run Contests, Raffles, and Giveaways with ContestsWP scored 63% from 54 tests.

About plugin

  • Plugin page: contest-code-checker
  • Plugin version: 1.9.8
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2.2
  • WordPress version: 6.3.1
  • First release: Jul 10, 2016
  • Latest release: Jul 5, 2023
  • Number of updates: 52
  • Update frequency: every 49.1 days
  • Top authors: mdedev (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active / 8,506 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲5.11MB] [CPU: ▲25.38ms] 75% from 4 tests

Analyzing server-side resources used by Run Contests, Raffles, and Giveaways with ContestsWP
Please fix the following
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.11MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.87 ▲5.4167.72 ▲29.32
Dashboard /wp-admin8.89 ▲5.5974.99 ▲26.42
Posts /wp-admin/edit.php8.89 ▲5.5480.13 ▲28.34
Add New Post /wp-admin/post-new.php9.80 ▲3.91125.64 ▲17.44
Media Library /wp-admin/upload.php8.89 ▲5.6774.31 ▲36.84
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.8960.50

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 506 new files
Database: no new tables, 9 new options
New WordPress options
fs_active_plugins
fs_accounts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
fs_debug_mode
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Run Contests, Raffles, and Giveaways with ContestsWP
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,979 ▲22214.00 ▼0.389.95 ▲8.1329.37 ▼20.52
Dashboard /wp-admin2,244 ▲564.95 ▼0.94108.12 ▲2.3765.70 ▲26.98
Posts /wp-admin/edit.php2,139 ▲532.44 ▲0.4040.11 ▲0.7037.80 ▲4.74
Add New Post /wp-admin/post-new.php1,703 ▲16122.30 ▲3.94706.56 ▲62.5032.94 ▼16.06
Media Library /wp-admin/upload.php1,432 ▲414.43 ▲0.24101.93 ▲2.2772.48 ▲29.87
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1071.8624.7927.34

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/contest-code-checker/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Incomplete uninstall procedure, leaving 506 files (4.31MB) in the plugin directory
    • (new file) free/README.txt
    • (new file) free/admin/contestants/class-contestants-table.php
    • (new file) contestswp.php
    • (new file) free/admin/class-contest-code-checker-admin-contestants.php
    • (new file) free/admin/class-contest-code-checker-admin-prizes.php
    • (new file) free/admin/class-contest-code-checker-admin-contest-codes.php
    • (new file) free/admin/contest_codes/class-contest-codes-table.php
    • (new file) free/admin/class-contest-code-checker-admin.php
    • (new file) README.txt
    • (new file) free/LICENSE.txt
    • ...
  • The uninstall procedure has failed, leaving 9 options in the database
    • fs_active_plugins
    • widget_theysaidso_widget
    • fs_accounts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • fs_debug_mode

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 74× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Box\\Spout\\Common\\Helper\\Escaper\\EscaperInterface' not found in wp-content/plugins/contest-code-checker/free/includes/spout/src/Spout/Common/Helper/Escaper/XLSX.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Box\\Spout\\Common\\Helper\\FileSystemHelperInterface' not found in wp-content/plugins/contest-code-checker/free/includes/spout/src/Spout/Writer/Common/Helper/FileSystemWithRootFolderHelperInterface.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Box\\Spout\\Reader\\IteratorInterface' not found in wp-content/plugins/contest-code-checker/free/includes/spout/src/Spout/Reader/XLSX/RowIterator.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Box\\Spout\\Common\\Creator\\HelperFactory' not found in wp-content/plugins/contest-code-checker/free/includes/spout/src/Spout/Writer/XLSX/Creator/HelperFactory.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Box\\Spout\\Common\\Exception\\SpoutException' not found in wp-content/plugins/contest-code-checker/free/includes/spout/src/Spout/Common/Exception/UnsupportedTypeException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Box\\Spout\\Reader\\Common\\Creator\\InternalEntityFactoryInterface' not found in wp-content/plugins/contest-code-checker/free/includes/spout/src/Spout/Reader/XLSX/Creator/InternalEntityFactory.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Box\\Spout\\Common\\Manager\\OptionsManagerAbstract' not found in wp-content/plugins/contest-code-checker/free/includes/spout/src/Spout/Writer/XLSX/Manager/OptionsManager.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Box\\Spout\\Common\\Manager\\OptionsManagerAbstract' not found in wp-content/plugins/contest-code-checker/free/includes/spout/src/Spout/Reader/ODS/Manager/OptionsManager.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Box\\Spout\\Writer\\Common\\Creator\\ManagerFactoryInterface' not found in wp-content/plugins/contest-code-checker/free/includes/spout/src/Spout/Writer/XLSX/Creator/ManagerFactory.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Box\\Spout\\Writer\\Exception\\WriterException' not found in wp-content/plugins/contest-code-checker/free/includes/spout/src/Spout/Writer/Exception/WriterNotOpenedException.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention: The official readme.txt is a good inspiration

contest-code-checker/contestswp.php 85% from 13 tests

This is the main PHP file of "Run Contests, Raffles, and Giveaways with ContestsWP" version 1.9.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Main file name: The principal plugin file should be the same as the plugin slug ("contest-code-checker.php" instead of "contestswp.php")

Code Analysis 97% from 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
Everything looks great! No dangerous files found in this plugin48,263 lines of code in 431 files:
LanguageFilesBlank linesComment linesLines of code
PHP28010,72124,40942,561
JavaScript1275891,0154,193
CSS1955671,201
PO File15275126
Markdown2420110
JSON10042
YAML15030

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity25.89
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity3.42
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces49
Interfaces14
Traits1
Classes192
▷ Abstract classes157.81%
▷ Concrete classes17792.19%
▷ Final classes00.00%
Methods2,220
▷ Static methods24310.95%
▷ Public methods1,52968.87%
▷ Protected methods2009.01%
▷ Private methods49122.12%
Functions112
▷ Named functions10694.64%
▷ Anonymous functions65.36%
Constants365
▷ Global constants10027.40%
▷ Class constants26572.60%
▷ Public constants265100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
24 PNG files occupy 0.28MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
free/admin/css/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
free/admin/css/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
free/public/images/contestswp_icon.png68.02KB17.75KB▼ 73.90%
free/admin/js/multi-select/img/switch.png0.53KB0.64KB0.00%
free/public/images/error.png1.50KB1.30KB▼ 13.19%