73% apa-banner-slider

Code Review | Apa Banner Slider

WordPress plugin Apa Banner Slider scored73%from 54 tests.

About plugin

  • Plugin page: apa-banner-slider
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.5.3
  • WordPress version: 6.3.1
  • First release: Jul 28, 2016
  • Latest release: Aug 20, 2016
  • Number of updates: 13
  • Update frequency: every 1.9 days
  • Top authors: aatmaadhikari (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,154 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.96MB] [CPU: ▼51.28ms] Passed 4 tests

A check of server-side resources used by Apa Banner Slider
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.447.97 ▼29.45
Dashboard /wp-admin2.05 ▼1.266.69 ▼40.04
Posts /wp-admin/edit.php2.05 ▼1.315.41 ▼43.89
Add New Post /wp-admin/post-new.php2.05 ▼3.845.90 ▼91.73
Media Library /wp-admin/upload.php2.05 ▼1.185.59 ▼28.34
Add Data /wp-admin/admin.php?page=list-plugin-data12.055.57
All Data /wp-admin/admin.php?page=list-plugin-data2.057.06
Banner Slider /wp-admin/admin.php?page=apa-banner-slider/slider.php2.055.46

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 35 new files
Database: 1 new table, 6 new options
New tables
wp_banners
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Apa Banner Slider
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲6414.22 ▼0.311.71 ▲0.1330.70 ▼9.91
Dashboard /wp-admin2,227 ▲505.53 ▼0.1382.41 ▼4.8374.25 ▲32.04
Posts /wp-admin/edit.php2,135 ▲351.99 ▼0.0438.12 ▼2.0038.01 ▼0.65
Add New Post /wp-admin/post-new.php1,706 ▲17522.18 ▼1.01669.19 ▼45.5560.48 ▼7.31
Media Library /wp-admin/upload.php1,432 ▲324.19 ▲0.0095.45 ▼3.7270.45 ▲25.64
Add Data /wp-admin/admin.php?page=list-plugin-data19331.9932.4233.53
All Data /wp-admin/admin.php?page=list-plugin-data8871.9923.7426.86
Banner Slider /wp-admin/admin.php?page=apa-banner-slider/slider.php8662.1825.1224.36

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the apaorder handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% 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)
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=apa-banner-slider/slider.php
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the apaorder handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 27 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=apa-banner-slider/slider.php
    • > 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/admin.php?page=list-plugin-data1
    • > Notice in wp-content/plugins/apa-banner-slider/addBanner.php+10
    Undefined index: bannerName
    • > GET request to /wp-admin/admin.php?page=list-plugin-data1
    • > Notice in wp-content/plugins/apa-banner-slider/addBanner.php+11
    Undefined index: link
    • > GET request to /wp-admin/admin.php?page=list-plugin-data1
    • > Notice in wp-content/plugins/apa-banner-slider/addBanner.php+12
    Undefined index: banner_heading
    • > GET request to /wp-admin/admin.php?page=list-plugin-data1
    • > Notice in wp-content/plugins/apa-banner-slider/addBanner.php+13
    Undefined index: banner_subheading
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=list-plugin-data1
    • > Notice in wp-content/plugins/apa-banner-slider/addBanner.php+169
    Undefined variable: error_message
    • > GET request to /wp-admin/admin.php?page=list-plugin-data1
    • > Notice in wp-content/plugins/apa-banner-slider/addBanner.php+171
    Undefined variable: result
    • > GET request to /wp-admin/admin.php?page=list-plugin-data1
    • > Notice in wp-content/plugins/apa-banner-slider/addBanner.php+171
    Trying to get property 'imgPath' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=apa-banner-slider/slider.php
    • > Notice in wp-content/plugins/apa-banner-slider/banners.php+20
    Undefined index: pageid
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=apa-banner-slider/slider.php
    • > Notice in wp-content/plugins/apa-banner-slider/banners.php+82
    Undefined variable: pagination

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: There are too many tags (17 tag instead of maximum 10)
  • Screenshots: Please add images for these screenshots: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from), #2 (This is the second screen shot)
  • Plugin Name: You should set the name of your plugin on the first line ( === apa-banner-slider === )
You can look at the official readme.txt

apa-banner-slider/slider.php 92% from 13 tests

The principal PHP file in "Apa Banner Slider" v. 1.0.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("apa-banner-slider.php" instead of "slider.php")

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
No dangerous file extensions were detected466 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP412938385
CSS115481

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
27 compressed PNG files occupy 0.15MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/annual_reports.png0.72KB0.74KB0.00%
images/hot_listing.png0.73KB0.84KB0.00%
images/not_special.png0.66KB0.68KB0.00%
images/banner_big.png2.07KB1.38KB▼ 33.60%
images/position.png0.71KB0.69KB▼ 3.96%