94% include

Code Review | Include

WordPress plugin Include scored 94% from 53 tests.

About plugin

  • Plugin page: include
  • Plugin version: 4.0.24
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5-5.2
  • WordPress version: 5.8.1
  • First release: Feb 18, 2014
  • Latest release: May 1, 2019
  • Number of updates: 97
  • Update frequency: every 19.6 days
  • Top authors: mflynn (84.54%)Clear_Code (13.4%)cngann (4.12%)

Code review

53 tests

User reviews

7 reviews

Install metrics

300+ active / 7,755 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.59MB] [CPU: ▼271.36ms] Passed 4 tests

An overview of server-side resources used by Include
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.42 ▲0.7033.39 ▲12.28
Dashboard /wp-admin3.65 ▲0.6048.86 ▲8.21
Posts /wp-admin/edit.php3.70 ▲0.5946.39 ▲2.13
Add New Post /wp-admin/post-new.php6.01 ▲0.5894.90 ▼1,082.16
Media Library /wp-admin/upload.php3.59 ▲0.5933.65 ▼13.62

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 31 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Include
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,669 ▲8715.86 ▼0.137.91 ▲0.3254.52 ▲1.27
Dashboard /wp-admin2,950 ▲1005.96 ▲0.10138.08 ▲0.06104.26 ▲1.71
Posts /wp-admin/edit.php2,726 ▲232.68 ▼0.0166.13 ▼1.2494.33 ▼1.38
Add New Post /wp-admin/post-new.php1,866 ▲1319.14 ▲0.07367.39 ▼6.66111.59 ▲12.65
Media Library /wp-admin/upload.php1,789 ▲175.02 ▼0.02143.87 ▼10.22111.61 ▼17.44

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Trait 'PluginFramework\\V_1_1\\PluginInfo' not found in wp-content/plugins/include/framework/core.class.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'PluginFramework\\V_1_1\\Core' not found in wp-content/plugins/include/plugin.class.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function PluginFramework\\V_1_1\\add_action() in wp-content/plugins/include/framework/traits/hooks.trait.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 15 tag instead of maximum 10
  • Screenshots: A description for screenshot #1 is required in include/assets to your readme.txt
You can take inspiration from this readme.txt

include/include.php Passed 13 tests

This is the main PHP file of "Include" version 4.0.24, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
67 characters long description:
Include a page, post, activity, or other query-object into another.

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
Success! There were no dangerous files found in this plugin2,736 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP252555292,672
Mustache519064

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity7.76
▷ Minimum class complexity1.00
▷ Maximum class complexity51.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces2
Interfaces5
Traits14
Classes30
▷ Abstract classes516.67%
▷ Concrete classes2583.33%
▷ Final classes00.00%
Methods269
▷ Static methods41.49%
▷ Public methods19873.61%
▷ Protected methods3312.27%
▷ Private methods3814.13%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants62
▷ Global constants00.00%
▷ Class constants62100.00%
▷ Public constants62100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected