84% addfunc-adaptive-content

Code Review | AddFunc Adaptive Content

WordPress plugin AddFunc Adaptive Content scored84%from 54 tests.

About plugin

  • Plugin page: addfunc-adaptive-...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.0
  • WordPress version: 6.3.1
  • First release: Sep 18, 2015
  • Latest release: Dec 11, 2018
  • Number of updates: 7
  • Update frequency: every 184.6 days
  • Top authors: joerhoney (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active /2,001 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼4.84ms] Passed 4 tests

A check of server-side resources used by AddFunc Adaptive Content
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1733.80 ▼12.96
Dashboard /wp-admin3.47 ▲0.1744.93 ▼5.36
Posts /wp-admin/edit.php3.59 ▲0.2349.45 ▼0.77
Add New Post /wp-admin/post-new.php6.05 ▲0.1797.25 ▲0.18
Media Library /wp-admin/upload.php3.40 ▲0.1736.74 ▼0.26

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

AddFunc Adaptive Content: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲5713.21 ▼1.162.05 ▲0.1538.24 ▼9.78
Dashboard /wp-admin2,209 ▲274.86 ▼1.03110.86 ▼12.2441.61 ▼7.07
Posts /wp-admin/edit.php2,089 ▼32.14 ▲0.1439.98 ▼3.7640.65 ▲3.35
Add New Post /wp-admin/post-new.php1,545 ▲1218.32 ▼4.81599.84 ▼123.9458.81 ▲0.36
Media Library /wp-admin/upload.php1,382 ▼64.18 ▼0.0796.90 ▼12.9742.96 ▼2.24

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/addfunc-adaptive-content/addfunc-adaptive-content.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Tags: Please delete some tags, you are using 38 tag instead of maximum 10
You can take inspiration from this readme.txt

addfunc-adaptive-content/addfunc-adaptive-content.php Passed 13 tests

The entry point to "AddFunc Adaptive Content" version 2.0 is a PHP file that has certain tags in its header comment area
106 characters long description:
Adds functions and shortcodes to empower WordPress users to have better control of when content is served.

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
Success! There were no dangerous files found in this plugin810 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2179672810

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.87
Average class complexity134.00
▷ Minimum class complexity134.00
▷ Maximum class complexity134.00
Average method complexity4.80
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods35
▷ Static methods925.71%
▷ Public methods3394.29%
▷ Protected methods25.71%
▷ Private methods00.00%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin