58% ebook-downloader

Code Review | Ebook Downloader

WordPress plugin Ebook Downloader scored58%from 54 tests.

About plugin

  • Plugin page: ebook-downloader
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8.1
  • WordPress version: 6.3.1
  • First release: Nov 21, 2014
  • Latest release: Dec 7, 2016
  • Number of updates: 8
  • Update frequency: every 130.4 days
  • Top authors: iwcontribution (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /4,790 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.86MB] [CPU: ▼31.25ms] Passed 4 tests

This is a short check of server-side resources used by Ebook Downloader
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1141.94 ▼7.32
Dashboard /wp-admin3.09 ▼0.2225.56 ▼28.99
Posts /wp-admin/edit.php3.09 ▼0.2727.27 ▼24.07
Add New Post /wp-admin/post-new.php3.09 ▼2.8029.50 ▼61.22
Media Library /wp-admin/upload.php3.09 ▼0.1527.64 ▼10.72
All Ebook /wp-admin/edit.php?post_type=ebook3.0927.11
Add New /wp-admin/post-new.php?post_type=ebook3.0928.00

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 14 new files
Database: 1 new table, 6 new options
New tables
wp_downloader_info
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Ebook Downloader
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲17013.44 ▼1.167.84 ▲5.9744.21 ▼1.64
Dashboard /wp-admin2,236 ▲565.58 ▲0.0585.42 ▼16.4439.59 ▼13.02
Posts /wp-admin/edit.php2,144 ▲472.03 ▼0.0140.87 ▲4.7835.81 ▼0.33
Add New Post /wp-admin/post-new.php1,575 ▲3523.31 ▼0.17606.48 ▼51.4058.49 ▲4.28
Media Library /wp-admin/upload.php1,441 ▲444.22 ▼0.01106.69 ▼4.2544.96 ▼0.20
All Ebook /wp-admin/edit.php?post_type=ebook1,1531.9734.7333.53
Add New /wp-admin/post-new.php?post_type=ebook2,6367.63171.5972.53

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_downloader_info
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=ebook
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/post-new.php?post_type=ebook
    • > Notice in wp-content/plugins/ebook-downloader/admin/create_ebook_post_type.php+87
    Undefined index: ebook_price
    • > GET request to /wp-admin/post-new.php?post_type=ebook
    • > Notice in wp-content/plugins/ebook-downloader/admin/create_ebook_post_type.php+88
    Undefined index: ebook_file

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
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ebook-downloader/admin/paypal_settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/ebook-downloader/ebook_shortcode.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ebook-downloader/admin/create_ebook_post_type.php:2
    • > PHP Warning
      Use of undefined constant EBOOK_PLUGIN_PATH - assumed 'EBOOK_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ebook-downloader/load.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'EBOOK_PLUGIN_PATH/admin/create_ebook_post_type.php' (include_path='.:/usr/share/php') in wp-content/plugins/ebook-downloader/load.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/ebook-downloader/ebook_plugin.php:18
    • > PHP Warning
      require_once(EBOOK_PLUGIN_PATH/admin/create_ebook_post_type.php): failed to open stream: No such file or directory in wp-content/plugins/ebook-downloader/load.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

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
2 plugin tags: download, ebook

ebook-downloader/ebook_plugin.php 92% from 13 tests

The main PHP script in "Ebook Downloader" version 1.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ebook-downloader.php" instead of "ebook_plugin.php")

Code Analysis Passed 3 tests

File types Passed 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
There were no executable files found in this plugin436 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP517133393
JavaScript26039
CSS13204

PHP code Passed 2 tests

A brief analysis 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.21
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%
Functions15
▷ Named functions15100.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.14MB with 0.06MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png4.73KB2.18KB▼ 53.93%
icon/pdf.png1.39KB1.35KB▼ 3.09%
assets/screenshot-1.png135.04KB28.87KB▼ 78.62%