78% pwr-ads

Code Review | Pwr-Ads

WordPress plugin Pwr-Ads scored78%from 54 tests.

About plugin

  • Plugin page: pwr-ads
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0
  • WordPress version: 6.3.1
  • First release: Jun 28, 2022
  • Latest release: Sep 28, 2022
  • Number of updates: 7
  • Update frequency: every 13.1 days
  • Top authors: pwradstest (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /212 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▲3.60ms] Passed 4 tests

An overview of server-side resources used by Pwr-Ads
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /6.61 ▲3.157,900.96 ▲7,859.17
Dashboard /wp-admin3.41 ▲0.1057.46 ▲3.88
Posts /wp-admin/edit.php3.52 ▲0.1653.94 ▲4.87
Add New Post /wp-admin/post-new.php5.99 ▲0.1092.38 ▲0.77
Media Library /wp-admin/upload.php3.33 ▲0.1038.45 ▲4.89

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 101 new files
Database: 3 new tables, 7 new options
New tables
wp_pwrads_users
wp_pwrads_ads
wp_pwrads_token
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_pwrads_sidebar_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Pwr-Ads
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,188 ▲45321.42 ▲7.0552.19 ▲50.4342.03 ▼5.18
Dashboard /wp-admin2,297 ▲1128.19 ▲3.31145.03 ▲28.0585.31 ▲40.96
Posts /wp-admin/edit.php2,198 ▲1125.32 ▲3.2965.78 ▲29.2036.80 ▼0.25
Add New Post /wp-admin/post-new.php1,578 ▲5927.01 ▲3.87656.21 ▼16.2835.34 ▼17.43
Media Library /wp-admin/upload.php1,485 ▲977.00 ▲2.81135.39 ▲34.6275.84 ▲30.90

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_pwrads_sidebar_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 7× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/pwr-ads/uninstall.php
    • > /wp-content/plugins/pwr-ads/admin/inc/db.php
    • > /wp-content/plugins/pwr-ads/pwr-ads-plugin.php
    • > /wp-content/plugins/pwr-ads/frontend/php/test.php
    • > /wp-content/plugins/pwr-ads/index.php
    • > /wp-content/plugins/pwr-ads/admin/inc/menu.php
    • > /wp-content/plugins/pwr-ads/frontend/function.php
  • 30× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_remote_retrieve_body() in wp-content/plugins/pwr-ads/frontend/autoadslayouts/header_temp.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_remote_retrieve_body() in wp-content/plugins/pwr-ads/frontend/layouts/pop_up_temp.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_remote_retrieve_body() in wp-content/plugins/pwr-ads/frontend/script_layouts/screen_pop_up.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_remote_retrieve_body() in wp-content/plugins/pwr-ads/frontend/autoadslayouts/float-top-right-temp.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_remote_retrieve_body() in wp-content/plugins/pwr-ads/frontend/layouts/float-top-right-temp.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_remote_retrieve_body() in wp-content/plugins/pwr-ads/frontend/layouts/float_left_temp.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_remote_retrieve_body() in wp-content/plugins/pwr-ads/frontend/script_layouts/top-right-corner.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_remote_retrieve_body() in wp-content/plugins/pwr-ads/frontend/autoadslayouts/footer_temp.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/pwr-ads/admin/inc/sign_up.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_remote_retrieve_body() in wp-content/plugins/pwr-ads/frontend/layouts/float-top-left-temp.php:7

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 issues were found

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
5 plugin tags: auto ads, earnings, custom ads, script ads, ads

pwr-ads/pwr-ads-plugin.php 92% from 13 tests

"Pwr-Ads" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("pwr-ads.php" instead of "pwr-ads-plugin.php")

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
Success! There were no dangerous files found in this plugin1,343 lines of code in 55 files:
LanguageFilesBlank linesComment linesLines of code
PHP37394120756
CSS75562578
JavaScript110189

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity10.25
▷ Minimum class complexity7.00
▷ Maximum class complexity12.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
13 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assests/img/tinymce-icon.png1.98KB1.30KB▼ 34.22%
(invalid) admin/assests/img/default_img_for_ads.png6.37KB0.00KB▼ 100.00%
frontend/asst/img/pwr-icon1.png3.83KB1.74KB▼ 54.65%
frontend/asst/img/pwr-icon.png1.95KB1.14KB▼ 41.74%
admin/assests/img/pwr-icon.png1.95KB1.14KB▼ 41.74%