84% adram

Code Review | AdRam

WordPress plugin AdRam scored 84% from 54 tests.

About plugin

  • Plugin page: adram
  • Plugin version: 0.4.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-4.9
  • WordPress version: 5.9.2
  • First release: Sep 20, 2018
  • Latest release: Oct 17, 2018
  • Number of updates: 11
  • Update frequency: every 3.6 days
  • Top authors: adram (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 428 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.06MB] [CPU: ▼310.51ms] Passed 4 tests

A check of server-side resources used by AdRam
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.12396.20 ▲345.97
Dashboard /wp-admin3.50 ▲0.0932.79 ▼4.47
Posts /wp-admin/edit.php3.72 ▲0.0837.84 ▲0.80
Add New Post /wp-admin/post-new.php6.96 ▼0.0192.37 ▼1,238.26
Media Library /wp-admin/upload.php3.37 ▲0.0826.35 ▼0.12
AdRam /wp-admin/options-general.php?page=adram-plugin3.3423.97

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 14 new files
Database: no new tables, 1 new option
New WordPress options
widget_adram_widget

Browser metrics Passed 4 tests

A check of browser resources used by AdRam
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,792 ▲3815.91 ▲0.296.05 ▲0.012.29 ▼0.26
Dashboard /wp-admin2,897 ▲396.11 ▼0.10115.10 ▼18.70152.16 ▼9.29
Posts /wp-admin/edit.php2,696 ▲23.24 ▼0.0061.83 ▼0.08135.72 ▼4.60
Add New Post /wp-admin/post-new.php1,755 ▲3721.56 ▲4.45446.38 ▲22.13156.64 ▼6.38
Media Library /wp-admin/upload.php1,706 ▲85.51 ▼0.05143.12 ▲5.79191.24 ▲0.76
AdRam /wp-admin/options-general.php?page=adram-plugin1,0912.4155.09139.77

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_adram_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/adram/adram.php:14
    • > PHP Warning
      Use of undefined constant ADRAM_HOSTNAME - assumed 'ADRAM_HOSTNAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/adram/includes/adram.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/adram/includes/widget.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/adram/admin/adram-admin.php:3
    • > PHP Warning
      Use of undefined constant ADRAM_HOSTNAME - assumed 'ADRAM_HOSTNAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/adram/includes/adram.php on line 3

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: ad, adram

adram/adram.php 92% from 13 tests

The primary PHP file in "AdRam" version 0.4.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

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 plugin408 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP54233361
PO File1151547

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions1794.44%
▷ Anonymous functions15.56%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.18MB with 0.12MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/banner-1544x500.png123.74KB51.13KB▼ 58.68%
images/banner-772x250.png61.24KB18.70KB▼ 69.46%