84% rp-ads-manager

Code Review | RedPic ADS Manager Lite

WordPress plugin RedPic ADS Manager Lite scored84%from 54 tests.

About plugin

  • Plugin page: rp-ads-manager
  • Plugin version: 1.6.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8.1
  • WordPress version: 6.3.1
  • First release: Dec 11, 2017
  • Latest release: Oct 13, 2021
  • Number of updates: 50
  • Update frequency: every 28.1 days
  • Top authors: sadikoff (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,816 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.28MB] [CPU: ▼6.38ms] Passed 4 tests

Server-side resources used by RedPic ADS Manager Lite
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3441.62 ▼3.30
Dashboard /wp-admin3.63 ▲0.2846.48 ▼8.13
Posts /wp-admin/edit.php3.68 ▲0.3250.30 ▼2.12
Add New Post /wp-admin/post-new.php6.15 ▲0.2682.04 ▼11.95
Media Library /wp-admin/upload.php3.49 ▲0.2638.01 ▲6.47
Settings /wp-admin/admin.php?page=rpam-settings3.5235.05
Codes /wp-admin/admin.php?page=rpam-codes3.6239.28
Groups /wp-admin/admin.php?page=rpam-groups3.5535.37
Dashboard /wp-admin/admin.php?page=rpam-dashboard3.4933.30
Shortcodes /wp-admin/admin.php?page=rpam-shortcodes3.5532.57

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 79 new files
Database: 4 new tables, 9 new options
New tables
wp_rpam_options
wp_rpam_codes
wp_rpam_groups
wp_rpam_shortcodes
New WordPress options
widget_recent-posts
widget_rp_ads_w_place
db_upgraded
rpam_remote_token
theysaidso_admin_options
rpam_db_version
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

RedPic ADS Manager Lite: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,864 ▲11813.54 ▼0.841.90 ▼0.1739.79 ▼12.39
Dashboard /wp-admin2,245 ▲904.85 ▼0.82107.21 ▲0.1339.95 ▲2.03
Posts /wp-admin/edit.php2,128 ▲362.12 ▲0.0942.64 ▲0.9335.26 ▼1.15
Add New Post /wp-admin/post-new.php1,573 ▲4018.41 ▼4.88595.04 ▼44.6255.54 ▲5.16
Media Library /wp-admin/upload.php1,424 ▲334.27 ▲0.0295.11 ▼2.9443.60 ▲1.29
Settings /wp-admin/admin.php?page=rpam-settings1,1623.9368.2554.85
Codes /wp-admin/admin.php?page=rpam-codes1,0922.0626.2231.48
Groups /wp-admin/admin.php?page=rpam-groups9292.0324.6926.60
Dashboard /wp-admin/admin.php?page=rpam-dashboard8902.0623.8031.49
Shortcodes /wp-admin/admin.php?page=rpam-shortcodes9262.0624.7827.04

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_rp_ads_w_place
    • db_upgraded
    • rpam_remote_token
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 49× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'RP\\AdsManager\\Import\\Rule' not found in wp-content/plugins/rp-ads-manager/src/Import/Rules/QuickAdsense.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/rp-ads-manager/templates/backend/codes/editor.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'RP\\AdsManager\\Hooks\\Hook' not found in wp-content/plugins/rp-ads-manager/src/Hooks/Frontend/LoopEnd.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/rp-ads-manager/templates/comming_soon.php:4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/rp-ads-manager/templates/backend/shortcodes/editor.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'RP\\AdsManager\\Database\\Helper' not found in wp-content/plugins/rp-ads-manager/src/Helper/Shortcode.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'RP\\AdsManager\\Util\\Singleton' not found in wp-content/plugins/rp-ads-manager/src/Helper/wpView.php:15
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/rp-ads-manager/templates/backend/groups/editor.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'RP\\AdsManager\\Hooks\\Hook' not found in wp-content/plugins/rp-ads-manager/src/Hooks/Backend/Settings.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/rp-ads-manager/templates/backend/codes/list.php:2

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (15 tag instead of maximum 10)
The official readme.txt is a good inspiration

rp-ads-manager/rp-ads-manager.php Passed 13 tests

Analyzing the main PHP file in "RedPic ADS Manager Lite" version 1.6.1
95 characters long description:
JS/HTML ads block manager. Allows you to create and insert blocks of code anywhere on the blog.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected7,200 lines of code in 74 files:
LanguageFilesBlank linesComment linesLines of code
PHP678095203,327
JavaScript35158732,641
CSS445491,232

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity6.94
▷ Minimum class complexity1.00
▷ Maximum class complexity34.00
Average method complexity2.53
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces12
Interfaces0
Traits0
Classes53
▷ Abstract classes611.32%
▷ Concrete classes4788.68%
▷ Final classes1531.91%
Methods195
▷ Static methods4221.54%
▷ Public methods15579.49%
▷ Protected methods84.10%
▷ Private methods3216.41%
Functions8
▷ Named functions225.00%
▷ Anonymous functions675.00%
Constants49
▷ Global constants36.12%
▷ Class constants4693.88%
▷ Public constants46100.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
There are no PNG files in this plugin