10% prime-ads

Code Review | Prime Ads

WordPress plugin Prime Ads scored 10% from 54 tests.

About plugin

  • Plugin page: prime-ads
  • Plugin version: 2.3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 6.3.1
  • First release: Jun 1, 2016
  • Latest release: May 21, 2018
  • Number of updates: 143
  • Update frequency: every 5.0 days
  • Top authors: devdmkr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 3,866 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/prime-ads/inc/SxGeo/SxGeo.php+217
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.60MB] [CPU: ▼50.36ms] Passed 4 tests

This is a short check of server-side resources used by Prime Ads
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.39 ▼1.075.84 ▼37.54
Dashboard /wp-admin2.41 ▼0.8910.11 ▼37.82
Posts /wp-admin/edit.php2.41 ▼0.957.38 ▼43.79
Add New Post /wp-admin/post-new.php2.41 ▼3.488.53 ▼82.27
Media Library /wp-admin/upload.php2.41 ▼0.828.74 ▼29.59
Prime Ads /wp-admin/options-general.php?page=primeads2.417.05

Server storage [IO: ▲13.10MB] [DB: ▲0.02MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 30 new files
Database: 11 new tables, 16 new options
New tables
wp_ads_text_block
wp_ads_code_block
wp_ads_simple_tizer_group
wp_ads_template
wp_ads_position
wp_ads_offer_post
wp_ads_simple_tizer_stat
wp_ads_comment
wp_ads_template_shows
wp_ads_simple_tizer
...
New WordPress options
ads-service-url
theysaidso_admin_options
ads-link-hash
ads-flushed
widget_recent-posts
db_upgraded
ads-clicks-checked
widget_theysaidso_widget
can_compress_scripts
ads-folder
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Prime Ads
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,968 ▲22213.75 ▼0.6011.99 ▲9.3940.63 ▼3.03
Dashboard /wp-admin2,213 ▲224.80 ▼1.10105.73 ▲2.4437.85 ▼9.11
Posts /wp-admin/edit.php2,093 ▲71.99 ▼0.0739.27 ▲1.0931.85 ▼3.39
Add New Post /wp-admin/post-new.php6,444 ▲4,91120.59 ▼2.67847.51 ▲178.6251.42 ▼5.35
Media Library /wp-admin/upload.php1,392 ▲104.16 ▼0.03117.29 ▲1.4256.88 ▲9.02
Prime Ads /wp-admin/options-general.php?page=primeads6781.536.4915.71

Uninstaller [IO: ▲0.04MB] [DB: ▲0.02MB] 25% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/prime-ads/inc/SxGeo/SxGeo.php+217
    Array and string offset access syntax with curly braces is deprecated
  • The uninstall procedure failed, leaving 11 tables in the database
    • wp_ads_simple_tizer_stat
    • wp_ads_code_block
    • wp_ads_position
    • wp_ads_template_shows
    • wp_ads_simple_tizer_group
    • wp_ads_offer_post
    • wp_ads_template
    • wp_ads_comment
    • wp_ads_simple_tizer
    • wp_ads_text_block
    • ...
  • Zombie WordPress options detected upon uninstall: 16 options
    • can_compress_scripts
    • ads-link-hash
    • ads-onoff
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • ads-folder
    • ads-clicks-checked
    • widget_recent-comments
    • widget_primeads
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=primeads
    • > Deprecated in wp-content/plugins/prime-ads/inc/SxGeo/SxGeo.php+249
    Array and string offset access syntax with curly braces is deprecated
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=primeads
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=primeads
    • > Notice in wp-content/plugins/prime-ads/inc/controllers/AdminController.php+14
    Undefined index: submit-key
    • > GET request to /wp-admin/options-general.php?page=primeads
    • > Notice in wp-content/plugins/prime-ads/inc/controllers/AdminController.php+77
    Undefined index: submit
    • > GET request to /wp-admin/options-general.php?page=primeads
    • > Compile error in wp-content/plugins/prime-ads/inc/views/admin/index.phtml+284
    'continue' not in the 'loop' or 'switch' context

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 fix the following
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/prime-ads/inc/widget.php:3
    • > PHP Notice
      Undefined index: action in wp-content/plugins/prime-ads/inc/direct.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function AdsNS\\get_option() in wp-content/plugins/prime-ads/prime-ads.php:24
    • > PHP Notice
      Undefined index: action in wp-content/plugins/prime-ads/inc/direct.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Plugin_Installer_Skin' not found in wp-content/plugins/prime-ads/inc/services/PluginUpgraderSkin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/prime-ads/inc/metabox.php: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 Passed 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
5 plugin tags: advertising, advert, prime ads, monetization, ads

prime-ads/prime-ads.php Passed 13 tests

"Prime Ads" version 2.3.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
53 characters long description:
Вывод рекламы с сервиса Prime Ads

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin5,217 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP187779314,405
JavaScript7180172812

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity63.00
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity4.90
▷ Minimum method complexity1.00
▷ Maximum method complexity79.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods202
▷ Static methods3617.82%
▷ Public methods15074.26%
▷ Protected methods104.95%
▷ Private methods4220.79%
Functions10
▷ Named functions770.00%
▷ Anonymous functions330.00%
Constants48
▷ Global constants1020.83%
▷ Class constants3879.17%
▷ Public constants38100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin