10% pad-article

Code Review | PAD article

WordPress plugin PAD article scored10%from 54 tests.

About plugin

  • Plugin page: pad-article
  • Plugin version: 1.02
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.1-3.4
  • WordPress version: 6.3.1
  • First release: Nov 5, 2012
  • Latest release: Apr 23, 2013
  • Number of updates: 8
  • Update frequency: every 21.4 days
  • Top authors: hilflo (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,332 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/pad-article/index.php+38
    Methods with the same name as their class will not be constructors in a future version of PHP; class_widget_PAD_a has a deprecated constructor

Server metrics [RAM: ▼1.84MB] [CPU: ▼56.50ms] Passed 4 tests

This is a short check of server-side resources used by PAD article
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.14 ▼1.324.07 ▼37.70
Dashboard /wp-admin2.16 ▼1.145.97 ▼44.29
Posts /wp-admin/edit.php2.16 ▼1.195.60 ▼44.51
Add New Post /wp-admin/post-new.php2.16 ▼3.726.03 ▼99.50
Media Library /wp-admin/upload.php2.16 ▼1.065.84 ▼29.07
Software article /wp-admin/options-general.php?page=Createarticle2.166.25

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 18 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_class_widget_pad_a
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

An overview of browser requirements for PAD article
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4913.63 ▼0.994.60 ▲2.8140.92 ▲2.25
Dashboard /wp-admin2,210 ▲195.91 ▲0.03106.28 ▲1.8840.45 ▼2.91
Posts /wp-admin/edit.php2,096 ▲72.05 ▲0.0340.31 ▲1.0134.54 ▲4.56
Add New Post /wp-admin/post-new.php1,536 ▲1723.57 ▲0.30584.30 ▼57.0855.23 ▲9.55
Media Library /wp-admin/upload.php1,392 ▲74.19 ▲0.0198.26 ▼1.6339.86 ▼4.75
Software article /wp-admin/options-general.php?page=Createarticle7551.536.8220.84

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/pad-article/index.php+38
    Methods with the same name as their class will not be constructors in a future version of PHP; class_widget_PAD_a has a deprecated constructor
  • The uninstall procedure has failed, leaving 8 options in the database
    • db_upgraded
    • widget_class_widget_pad_a
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% 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)
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=Createarticle
    • > Deprecated in wp-content/plugins/pad-article/index.php+38
    Methods with the same name as their class will not be constructors in a future version of PHP; class_widget_PAD_a has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=Createarticle
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in class_widget_PAD_a is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=Createarticle
    • > User deprecated in wp-includes/functions.php+5747
    Function load_plugin_textdomain was called with an argument that is deprecated since version 2.7.0 with no alternative available.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=Createarticle
    • > 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/options-general.php?page=Createarticle
    • > Notice in wp-content/plugins/pad-article/pad_admin.php+3
    Undefined index: pad_hidden
    • > GET request to /wp-admin/options-general.php?page=Createarticle
    • > Notice in wp-content/plugins/pad-article/pad_admin.php+24
    Undefined index: add_article
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=Createarticle
    • > Notice in wp-content/plugins/pad-article/pad_admin.php+91
    Undefined variable: lang
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=Createarticle
    • > Notice in wp-content/plugins/pad-article/pad_admin.php+91
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/options-general.php?page=Createarticle
    • > Deprecated in wp-content/plugins/pad-article/include/padfile.php+52
    Methods with the same name as their class will not be constructors in a future version of PHP; PADFile has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=Createarticle
    • > Parse error in wp-content/plugins/pad-article/include/xmlfile.php+132
    syntax error, unexpected 'new' (T_NEW)

SRP 50% 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
  • 18× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Parse error
      syntax error, unexpected '&', expecting ')' in wp-content/plugins/pad-article/include/padvalidator.php on line 84
    • > PHP Warning
      include_once(./include/padvalidator.php): failed to open stream: No such file or directory in wp-content/plugins/pad-article/samples/validate.php on line 5
    • > PHP Parse error
      syntax error, unexpected 'new' (T_NEW) in wp-content/plugins/pad-article/include/xmlfile.php on line 132
    • > PHP Warning
      include_once(): Failed opening './include/padfile.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/pad-article/samples/prefill.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/pad-article/pad_admin.php:19
    • > PHP Warning
      include_once(): Failed opening './include/padfile.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/pad-article/samples/extract.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pad-article/index.php:17
    • > PHP Warning
      include_once(): Failed opening './include/padfile.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/pad-article/samples/validate.php on line 4
    • > PHP Notice
      Undefined index: pad_hidden in wp-content/plugins/pad-article/pad_admin.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PADFile' not found in wp-content/plugins/pad-article/samples/validate.php:22

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === pad-article === )
The official readme.txt is a good inspiration

pad-article/index.php 92% from 13 tests

The principal PHP file in "PAD article" v. 1.02 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("pad-article.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected2,909 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP113396382,126
XML200646
PO File14963127
CSS10010

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity24.73
▷ Minimum class complexity1.00
▷ Maximum class complexity205.00
Average method complexity4.68
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods71
▷ Static methods34.23%
▷ Public methods4157.75%
▷ Protected methods3042.25%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants50
▷ Global constants50100.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
No PNG files were detected