10% wp-keys-giveaway

Code Review | WP Keys Giveaway

WordPress plugin WP Keys Giveaway scored 10% from 54 tests.

About plugin

  • Plugin page: wp-keys-giveaway
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.6
  • WordPress version: 6.3.1
  • First release: Oct 20, 2012
  • Latest release: Oct 12, 2013
  • Number of updates: 7
  • Update frequency: every 51.1 days
  • Top authors: shad9w (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

30+ active / 2,284 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)

Server metrics [RAM: ▲0.10MB] [CPU: ▼3.99ms] Passed 4 tests

Analyzing server-side resources used by WP Keys Giveaway
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1039.09 ▼1.71
Dashboard /wp-admin3.40 ▲0.1046.36 ▼2.28
Posts /wp-admin/edit.php3.45 ▲0.1045.37 ▼0.69
Add New Post /wp-admin/post-new.php6.01 ▲0.1285.72 ▼11.28
Media Library /wp-admin/upload.php3.33 ▲0.1038.15 ▲2.76
Add Key Giveaway /wp-admin/post-new.php?post_type=sh9_betakey3.3647.40
WP Keys Giveaway /wp-admin/edit.php?post_type=sh9_betakey3.3739.20

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 10 new files
Database: 1 new table, 6 new options
New tables
wp_sh9_betakeys
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Keys Giveaway
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,949 ▲21413.79 ▼0.509.47 ▲7.8040.34 ▼0.45
Dashboard /wp-admin2,241 ▲505.84 ▲0.9698.90 ▼7.77104.34 ▲64.43
Posts /wp-admin/edit.php2,124 ▲352.03 ▲0.0437.08 ▲0.0230.92 ▲0.47
Add New Post /wp-admin/post-new.php1,550 ▲3023.15 ▲0.14658.81 ▲25.7760.39 ▼8.27
Media Library /wp-admin/upload.php1,423 ▲324.14 ▲0.04101.04 ▼1.2273.50 ▲30.22
Add Key Giveaway /wp-admin/post-new.php?post_type=sh9_betakey1,4932.5251.90100.98
Donate /wp-admin/key_giveaway.php260.440.0814.35
WP Keys Giveaway /wp-admin/edit.php?post_type=sh9_betakey1,0911.9534.9731.66

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
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/wp-keys-giveaway/uninstall.php+11
    Constant SH9BKTABLE already defined
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wp-keys-giveaway/key_giveaway.php:13
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-keys-giveaway/key_giveaway.php on line 13

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/key_giveaway.php
    • > Network (severe)
    wp-admin/key_giveaway.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: beta keys giveaway, giveaway, wp keys giveaway, keys giveaway

wp-keys-giveaway/key_giveaway.php 92% from 13 tests

The main file in "WP Keys Giveaway" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-keys-giveaway.php" instead of "key_giveaway.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected329 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP25816276
JavaScript23142
CSS12011

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
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%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/get-your-key.png8.13KB3.98KB▼ 51.07%
images/delete.png0.50KB0.53KB0.00%
images/icon.png0.43KB0.33KB▼ 21.87%