37% give-it-away-now

Code Review | Give It Away Now!

WordPress plugin Give It Away Now! scored 37% from 54 tests.

About plugin

  • Plugin page: give-it-away-now
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.9.1
  • WordPress version: 6.3.1
  • First release: May 4, 2014
  • Latest release: Jun 25, 2014
  • Number of updates: 12
  • Update frequency: every 4.3 days
  • Top authors: EthanT (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

10+ active / 3,752 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.87MB] [CPU: ▼38.70ms] Passed 4 tests

An overview of server-side resources used by Give It Away Now!
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.09 ▼0.3716.58 ▼27.14
Dashboard /wp-admin3.14 ▼0.1621.90 ▼29.03
Posts /wp-admin/edit.php3.14 ▼0.2122.35 ▼24.22
Add New Post /wp-admin/post-new.php3.14 ▼2.7522.81 ▼74.42
Media Library /wp-admin/upload.php3.14 ▼0.0922.74 ▼10.18
All Giveaways /wp-admin/edit.php?post_type=giveaway3.1418.68
Add New /wp-admin/post-new.php?post_type=giveaway3.1420.45

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 857 new files
Database: 1 new table, 6 new options
New tables
wp_give_it_away
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Give It Away Now!
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,977 ▲24215.12 ▲0.831.67 ▼0.2841.87 ▼2.57
Dashboard /wp-admin2,383 ▲1916.52 ▲1.57132.21 ▲10.8042.20 ▼5.55
Posts /wp-admin/edit.php2,286 ▲1973.40 ▲1.3655.06 ▲19.6635.47 ▲0.28
Add New Post /wp-admin/post-new.php1,575 ▲4023.58 ▲0.55678.49 ▲36.5535.34 ▼42.38
Media Library /wp-admin/upload.php1,428 ▲404.18 ▼0.0279.99 ▼15.4941.18 ▼1.86
Give it Away Now Entries /wp-admin/giveaway-form.php260.440.1113.69
All Giveaways /wp-admin/edit.php?post_type=giveaway1,2593.4045.2225.35
Add New /wp-admin/post-new.php?post_type=giveaway2,9029.68253.6179.04

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/give-it-away-now/includes/metabox/init.php+724
    count(): Parameter must be an array or an object that implements Countable
  • Zombie tables detected upon uninstall: 1 table
    • wp_give_it_away
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 0% 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)
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=giveaway
    • > Warning in wp-content/plugins/give-it-away-now/includes/metabox/init.php+724
    count(): Parameter must be an array or an object that implements Countable

SRP 0% 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
The following issues need your attention
  • 16× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/give-it-away-now/includes/datatables/media/unit_testing/templates/6776.php
    • > /wp-content/plugins/give-it-away-now/includes/datatables/media/unit_testing/templates/two_tables.php
    • > /wp-content/plugins/give-it-away-now/includes/datatables/media/unit_testing/templates/dom_data.php
    • > /wp-content/plugins/give-it-away-now/includes/datatables/media/unit_testing/templates/empty_table.php
    • > /wp-content/plugins/give-it-away-now/includes/datatables/media/unit_testing/templates/deferred_table.php
    • > /wp-content/plugins/give-it-away-now/includes/datatables/media/unit_testing/templates/js_data.php
    • > /wp-content/plugins/give-it-away-now/includes/datatables/media/unit_testing/templates/-complex_header.php
    • > /wp-content/plugins/give-it-away-now/includes/datatables/media/unit_testing/templates/js_data_mixed_types.php
    • > /wp-content/plugins/give-it-away-now/includes/datatables/media/unit_testing/templates/dom_data_two_headers.php
    • > /wp-content/plugins/give-it-away-now/includes/datatables/media/unit_testing/controller.php
  • 60× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      include(): Failed opening 'datatables/mysql.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/give-it-away-now/includes/datatables/examples/server_side/scripts/custom_data_property.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mysql_pconnect() in wp-content/plugins/give-it-away-now/includes/datatables/examples/server_side/scripts/jsonp.php:45
    • > PHP Notice
      Undefined index: scripts in wp-content/plugins/give-it-away-now/includes/datatables/media/unit_testing/templates/js_data.php on line 84
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mysql_pconnect() in wp-content/plugins/give-it-away-now/includes/datatables/examples/server_side/scripts/server_processing.php:45
    • > PHP Warning
      include(datatables/mysql.php): failed to open stream: No such file or directory in wp-content/plugins/give-it-away-now/includes/datatables/examples/server_side/scripts/jsonp.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/give-it-away-now/giveaway-admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/give-it-away-now/giveaway-admin.php:3
    • > PHP Warning
      include(datatables/mysql.php): failed to open stream: No such file or directory in wp-content/plugins/give-it-away-now/includes/datatables/examples/server_side/scripts/post.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mysql_pconnect() in wp-content/plugins/give-it-away-now/includes/datatables/examples/server_side/scripts/objects.php:45
    • > PHP Warning
      include(): Failed opening 'datatables/mysql.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/give-it-away-now/includes/datatables/extras/Scroller/media/data/server_processing.php on line 24

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/giveaway-form.php
    • > Network (severe)
    wp-admin/giveaway-form.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

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: contest, entry, custom post type, giveaways

give-it-away-now/giveaway.php 92% from 13 tests

Analyzing the main PHP file in "Give It Away Now!" version 1.3
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("give-it-away-now.php" instead of "giveaway.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Please make sure to remedy the following
  • For security reasons, never distribute binary or executable files with your plugin
    • .as - Adobe Flash ActionScript File in Adobe Flash
      • wp-content/plugins/give-it-away-now/includes/datatables/extras/TableTools/media/as3/ZeroClipboard.as
      • wp-content/plugins/give-it-away-now/includes/datatables/extras/TableTools/media/as3/ZeroClipboardPdf.as
160,239 lines of code in 685 files:
LanguageFilesBlank linesComment linesLines of code
HTML2214,484187,977
JavaScript38611,15419,39059,441
PHP409521,5827,532
CSS227037604,049
Markdown41630391
ActionScript28465382
Bourne Shell2355232
JSON600159
SQL11066
YAML10010

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity64.50
▷ Minimum class complexity20.00
▷ Maximum class complexity133.00
Average method complexity3.89
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods132
▷ Static methods3325.00%
▷ Public methods13098.48%
▷ Protected methods21.52%
▷ Private methods00.00%
Functions34
▷ Named functions34100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
84 PNG files occupy 0.13MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/datatables/media/images/sort_desc_disabled.png1.02KB0.25KB▼ 75.98%
includes/datatables/media/images/sort_both.png1.11KB0.29KB▼ 74.12%
includes/datatables/extras/TableTools/media/images/xls.png1.60KB1.01KB▼ 36.93%
includes/datatables/extras/Scroller/media/docs/media/images/arrow.png0.99KB0.17KB▼ 82.59%
includes/datatables/examples/examples_support/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%