10% smartyads

Code Review | SmartyAds

WordPress plugin SmartyAds scored 10% from 54 tests.

About plugin

  • Plugin page: smartyads
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.0
  • WordPress version: 5.8.1
  • First release: Oct 17, 2014
  • Latest release: Oct 20, 2014
  • Number of updates: 7
  • Update frequency: every 0.6 days
  • Top authors: SmartyAds (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 932 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/smartyads/smartyads-widget.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; SmartyAdsWidget has a deprecated constructor

Server metrics [RAM: ▼1.83MB] [CPU: ▼188.77ms] Passed 4 tests

Analyzing server-side resources used by SmartyAds
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.80 ▼1.036.03 ▼27.33
Dashboard /wp-admin1.82 ▼1.246.11 ▼34.97
Posts /wp-admin/edit.php1.82 ▼1.296.41 ▼39.55
Add New Post /wp-admin/post-new.php1.82 ▼3.616.01 ▼646.38
Media Library /wp-admin/upload.php1.82 ▼1.196.35 ▼34.19
SmartyAds /wp-admin/options-general.php?page=settings1.826.46

Server storage [IO: ▲0.02MB] [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: 8 new files
Database: no new tables, 2 new options
New WordPress options
smarty_new_key_valid
widget_smartyadswidget

Browser metrics Passed 4 tests

This is an overview of browser requirements for SmartyAds
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,688 ▲9215.91 ▲0.178.94 ▼1.6845.63 ▲0.94
Dashboard /wp-admin2,976 ▲456.06 ▲0.12136.48 ▼7.05107.94 ▲0.34
Posts /wp-admin/edit.php2,748 ▲92.71 ▼0.0064.86 ▼0.2484.14 ▼7.16
Add New Post /wp-admin/post-new.php1,679 ▲6418.92 ▼2.98383.62 ▲122.47106.51 ▼4.06
Media Library /wp-admin/upload.php1,816 ▲95.05 ▲0.03155.17 ▲10.99125.28 ▼5.60
SmartyAds /wp-admin/options-general.php?page=settings1,0472.1250.8774.87

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
These items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/smartyads/smartyads-widget.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; SmartyAdsWidget has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 2 options
    • smarty_new_key_valid
    • widget_smartyadswidget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=settings
    • > Deprecated in wp-content/plugins/smartyads/smartyads-widget.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; SmartyAdsWidget has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=settings
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in SmartyAdsWidget is deprecated since version 4.3.0! Use __construct() instead.

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
Please take a closer look at the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/smartyads/smartyads.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/smartyads/smartyads-widget.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
10 plugin tags: banners, cpm, income, money, monetization...

smartyads/smartyads.php Passed 13 tests

"SmartyAds" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
128 characters long description:
This plugin will automate adding SmartyAds advertisement to your blog posts. SmartyAds will show your blog viewers targeted ads.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin404 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP39212167
CSS14512143
PO File1161649
JavaScript127045

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity6.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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin