88% download-info-page

Code Review | WP资源下载管理

WordPress plugin WP资源下载管理 scored 88% from 54 tests.

About plugin

  • Plugin page: download-info-page
  • Plugin version: 1.3.8
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.8
  • WordPress version: 5.8.1
  • First release: Mar 23, 2016
  • Latest release: Aug 9, 2021
  • Number of updates: 73
  • Update frequency: every 26.9 days
  • Top authors: wbolt (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active / 19,407 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.12MB] [CPU: ▼138.89ms] Passed 4 tests

Server-side resources used by WP资源下载管理
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.92 ▲0.2040.40 ▲17.54
Dashboard /wp-admin3.16 ▲0.1150.34 ▼5.93
Posts /wp-admin/edit.php3.27 ▲0.1752.28 ▲1.23
Add New Post /wp-admin/post-new.php5.52 ▲0.08102.57 ▼563.65
Media Library /wp-admin/upload.php3.11 ▲0.1047.60 ▲12.79
WP资源下载管理 /wp-admin/options-general.php?page=dlip_pack3.1036.12

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 20 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for WP资源下载管理
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11215.95 ▼0.0513.22 ▲4.2255.05 ▲6.03
Dashboard /wp-admin2,994 ▲605.98 ▼0.22164.76 ▼9.27123.48 ▲4.50
Posts /wp-admin/edit.php2,744 ▲52.72 ▼0.0078.09 ▼9.75100.51 ▲1.17
Add New Post /wp-admin/post-new.php1,912 ▲22923.25 ▲7.49399.06 ▼54.39165.00 ▲47.86
Media Library /wp-admin/upload.php1,812 ▲55.04 ▲0.02169.61 ▼4.65133.34 ▲7.77
WP资源下载管理 /wp-admin/options-general.php?page=dlip_pack2,6412.7372.38236.09

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/download-info-page/tpl/widget_download.php
    • > /wp-content/plugins/download-info-page/tpl/download.php
    • > /wp-content/plugins/download-info-page/tpl/download_btn.php
  • 36× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: meta_value in wp-content/plugins/download-info-page/tpl/meta_box.php on line 51
    • > PHP Notice
      Undefined variable: need_login in wp-content/plugins/download-info-page/tpl/download.php on line 31
    • > PHP Notice
      Undefined variable: meta_value in wp-content/plugins/download-info-page/tpl/meta_box.php on line 62
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/download-info-page/tpl/meta_box.php:88
    • > PHP Notice
      Undefined variable: wpvk_install in wp-content/plugins/download-info-page/tpl/meta_box.php on line 86
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/download-info-page/tpl/meta_box.php on line 45
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/download-info-page/tpl/meta_box.php on line 51
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/download-info-page/tpl/meta_box.php on line 55
    • > PHP Notice
      Undefined variable: display_count in wp-content/plugins/download-info-page/tpl/widget_download.php on line 20
    • > PHP Notice
      Undefined variable: wpvk_install in wp-content/plugins/download-info-page/tpl/meta_box.php on line 83

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)
No browser errors were detected

Optimizations

Plugin configuration 93% 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: thunder, magnet download, download, url

download-info-page/index.php 85% from 13 tests

The primary PHP file in "WP资源下载管理" version 1.3.8 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 251 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("download-info-page.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin767 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP10208138758
CSS40184
JavaScript4004
HTML1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity35.33
▷ Minimum class complexity1.00
▷ Maximum class complexity79.00
Average method complexity4.55
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods29
▷ Static methods1137.93%
▷ Public methods2896.55%
▷ Protected methods00.00%
▷ Private methods13.45%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin