83% native-ads-adnow

Code Review | Adnow Native Widget

WordPress plugin Adnow Native Widget scored83%from 54 tests.

About plugin

  • Plugin page: native-ads-adnow
  • Plugin version: 2.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Feb 20, 2017
  • Latest release: Jun 2, 2023
  • Number of updates: 29
  • Update frequency: every 78.8 days
  • Top authors: vbadnow (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /24,514 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.26MB] [CPU: ▲534.82ms] 50% from 4 tests

Server-side resources used by Adnow Native Widget
Please take the time to fix the following items
  • CPU: Total CPU usage must kept under 500.00ms (currently 622.68ms on /wp-admin/admin.php?page=adnow-widget)
  • Extra CPU: Try to keep extra CPU usage under 200.00ms (currently 534.82ms on /wp-admin/admin.php?page=adnow-widget)
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.29616.75 ▲575.00
Dashboard /wp-admin3.57 ▲0.23594.36 ▲528.92
Posts /wp-admin/edit.php3.62 ▲0.27616.37 ▲564.88
Add New Post /wp-admin/post-new.php6.17 ▲0.29628.16 ▲514.71
Media Library /wp-admin/upload.php3.49 ▲0.27565.25 ▲530.78
Edit place /wp-admin/admin.php?page=edit_place3.40563.40
Adnow Plugin /wp-admin/admin.php?page=adnow-widget3.40622.68

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 64 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Adnow Native Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,947 ▲20113.94 ▼0.528.77 ▲6.9437.78 ▼7.24
Dashboard /wp-admin2,243 ▲524.86 ▼1.03102.25 ▼1.8641.07 ▼3.28
Posts /wp-admin/edit.php2,129 ▲401.99 ▼0.0639.35 ▼1.1537.51 ▲1.18
Add New Post /wp-admin/post-new.php1,542 ▲1221.50 ▲3.40654.74 ▲9.1458.85 ▼3.80
Media Library /wp-admin/upload.php1,425 ▲404.21 ▼0.04101.14 ▼10.9645.27 ▲1.22
Edit place /wp-admin/admin.php?page=edit_place1,5062.2427.9731.54
Adnow Plugin /wp-admin/admin.php?page=adnow-widget8202.0323.6424.02

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/native-ads-adnow/admin/partials/adnow-widget-admin-display.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/native-ads-adnow/admin/partials/class-adnow-widget-area.php:28

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

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: monetization, ad network, native ads, advertising

native-ads-adnow/adnow-widget.php 85% from 13 tests

The main PHP file in "Adnow Native Widget" ver. 2.0.2 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("native-ads-adnow.php" instead of "adnow-widget.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
There were no executable files found in this plugin1,679 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
CSS21232853
PHP18222861819
JavaScript21137

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity11.20
▷ Minimum class complexity1.00
▷ Maximum class complexity83.00
Average method complexity2.59
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods65
▷ Static methods23.08%
▷ Public methods4975.38%
▷ Protected methods00.00%
▷ Private methods1624.62%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
20 PNG files occupy 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/plus.png1.11KB0.17KB▼ 84.34%
admin/images/view-2.png18.36KB0.72KB▼ 96.10%
public/images/success.png1.75KB0.95KB▼ 45.53%
admin/images/error.png2.06KB1.03KB▼ 50.02%
public/images/error.png2.06KB1.03KB▼ 50.02%