58% ap-background

Code Review | AP Background

WordPress plugin AP Background scored58%from 54 tests.

About plugin

  • Plugin page: ap-background
  • Plugin version: 3.8.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Jul 16, 2022
  • Latest release: Jul 17, 2022
  • Number of updates: 8
  • Update frequency: every 0.3 days
  • Top authors: hovanesvn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /735 total downloads


Plugin footprint 48% 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: ▲0.41MB] [CPU: ▼0.17ms] Passed 4 tests

This is a short check of server-side resources used by AP Background
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2342.12 ▼1.26
Dashboard /wp-admin3.83 ▲0.5363.23 ▲5.16
Posts /wp-admin/edit.php3.88 ▲0.5260.83 ▲8.28
Add New Post /wp-admin/post-new.php6.34 ▲0.4696.31 ▼12.85
Media Library /wp-admin/upload.php3.66 ▲0.4445.80 ▲9.23

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 106 new files
Database: 1 new table, 7 new options
New tables
New WordPress options

Browser metrics Passed 4 tests

AP Background: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,134 ▲38815.39 ▲1.026.28 ▲4.5143.82 ▼1.15
Dashboard /wp-admin2,375 ▲1906.76 ▲1.83141.99 ▲36.4092.00 ▲47.33
Posts /wp-admin/edit.php2,299 ▲2313.67 ▲1.6249.44 ▲10.3165.27 ▲26.97
Add New Post /wp-admin/post-new.php1,712 ▲17922.61 ▼0.60661.84 ▲21.1737.41 ▼20.12
Media Library /wp-admin/upload.php1,423 ▲384.43 ▲0.2382.93 ▼20.2484.90 ▲42.69

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'ap_background_uninstall' not found or invalid function name
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_ap_background
  • Zombie WordPress options were found after uninstall: 7 options
    • ap_background_db_version
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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
Please fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/ap-background/includes/html/parallax_content/image-content-layout/default.php
    • > /wp-content/plugins/ap-background/includes/html/parallax_content/image-content-layout/flexible.php
  • 93× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: query in wp-content/plugins/ap-background/includes/html/parallax_content/wp-content-layout/layout1.php on line 12
    • > PHP Warning
      Use of undefined constant SFAPB_PLUGIN_DIR - assumed 'SFAPB_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/ap-background/includes/functions.front.php on line 10
    • > PHP Notice
      Trying to get property 'order' of non-object in wp-content/plugins/ap-background/includes/html/parallax_content/wp-post.php on line 25
    • > PHP Notice
      Trying to get property 'limit' of non-object in wp-content/plugins/ap-background/includes/html/parallax_content/wp-post.php on line 23
    • > PHP Notice
      Undefined variable: query in wp-content/plugins/ap-background/includes/html/parallax_content/woo-content-layout/layout2.php on line 11
    • > PHP Notice
      Trying to get property 'media_source' of non-object in wp-content/plugins/ap-background/includes/html/parallax_content/video.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ap-background/includes/html/create_new.woo_commerce.php:13
    • > PHP Notice
      Trying to get property 'product_content_type' of non-object in wp-content/plugins/ap-background/includes/html/parallax_content/woo-commerce.php on line 42
    • > PHP Notice
      Trying to get property 'product_content_type' of non-object in wp-content/plugins/ap-background/includes/html/parallax_content/woo-commerce.php on line 34
    • > PHP Notice
      Trying to get property 'spacing' of non-object in wp-content/plugins/ap-background/includes/html/parallax_content/image-content-layout/flexible.php on line 12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found


Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: background parallax, advance parallax, parallax, popup parallax, parallax background

ap-background/ap_background.php 85% from 13 tests

The principal PHP file in "AP Background" v. 3.8.2 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ap-background.php" instead of "ap_background.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 295 characters long)

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 plugin8,092 lines of code in 58 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity40.00
▷ Minimum class complexity3.00
▷ Maximum class complexity110.00
Average method complexity4.68
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
▷ Static methods815.09%
▷ Public methods4788.68%
▷ Protected methods00.00%
▷ Private methods611.32%
▷ Named functions2896.55%
▷ Anonymous functions13.45%
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
43 PNG files occupy 0.16MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/pattern-2.png0.91KB0.10KB▼ 89.22%
assets/images/default.png1.55KB0.77KB▼ 50.53%
assets/images/pattern-9.png0.92KB0.11KB▼ 88.16%
assets/images/pattern-11.png0.94KB0.11KB▼ 88.00%