57% download-magnet

Code Review | Download Magnet

WordPress plugin Download Magnet scored57%from 54 tests.

About plugin

  • Plugin page: download-magnet
  • Plugin version: 1.5.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Mar 16, 2023
  • Latest release: Aug 26, 2023
  • Number of updates: 7
  • Update frequency: every 24.0 days
  • Top authors: peachysoftware (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /347 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲5.02MB] [CPU: ▲32.32ms] 75% from 4 tests

An overview of server-side resources used by Download Magnet
Please have a look at the following items
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.02MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.88 ▲5.4272.91 ▲26.81
Dashboard /wp-admin8.90 ▲5.5977.01 ▲30.99
Posts /wp-admin/edit.php8.90 ▲5.5482.97 ▲34.73
Add New Post /wp-admin/post-new.php9.43 ▲3.54135.63 ▲37.83
Media Library /wp-admin/upload.php8.90 ▲5.6769.35 ▲36.76
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9058.82

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 193 new files
Database: 1 new table, 9 new options
New tables
wp_psdm_downloads
New WordPress options
can_compress_scripts
theysaidso_admin_options
fs_debug_mode
db_upgraded
widget_recent-comments
fs_active_plugins
fs_accounts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Download Magnet
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,946 ▲21113.91 ▼0.767.80 ▲5.5828.08 ▼11.84
Dashboard /wp-admin2,244 ▲535.86 ▲0.99107.47 ▲6.3845.73 ▲4.22
Posts /wp-admin/edit.php2,127 ▲382.12 ▲0.0939.97 ▲0.1637.86 ▲0.89
Add New Post /wp-admin/post-new.php1,538 ▲1823.09 ▼0.05632.60 ▲0.4650.73 ▼3.94
Media Library /wp-admin/upload.php1,423 ▲354.24 ▲0.03102.96 ▲9.5145.21 ▲4.33
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0881.8127.5029.83

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
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/download-magnet/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_psdm_downloads
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • fs_debug_mode
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • fs_accounts
    • fs_active_plugins
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not 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
Please fix the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/download-magnet/downloadmagnet.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/download-magnet/includes/class-psdm-list-table.php on line 13
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/download-magnet/includes/class-psdm-list-table.php on line 13
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/download-magnet/includes/class-psdm-list-table.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

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
These attributes need your attention:
  • Donate link: Please fix this invalid url: ""
You can take inspiration from this readme.txt

download-magnet/downloadmagnet.php 92% from 13 tests

The main PHP file in "Download Magnet" ver. 1.5.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("download-magnet.php" instead of "downloadmagnet.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected34,876 lines of code in 144 files:
LanguageFilesBlank linesComment linesLines of code
PHP1208,10717,37334,074
JavaScript75564334
CSS15452253
Markdown1680214
SVG1001

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity92.06
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.61
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes50
▷ Abstract classes24.00%
▷ Concrete classes4896.00%
▷ Final classes00.00%
Methods1,290
▷ Static methods19715.27%
▷ Public methods90069.77%
▷ Protected methods171.32%
▷ Private methods37328.91%
Functions100
▷ Named functions100100.00%
▷ Anonymous functions00.00%
Constants145
▷ Global constants9867.59%
▷ Class constants4732.41%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
7 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/psdm_addons.png43.20KB15.38KB▼ 64.39%
includes/images/notification.png3.13KB1.91KB▼ 38.90%
includes/images/email.png3.44KB2.03KB▼ 40.89%
includes/images/downloadmagnet100.png2.60KB1.85KB▼ 29.03%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%