10% site-assets

Code Review | Site Assets

WordPress plugin Site Assets scored10%from 54 tests.

About plugin

  • Plugin page: site-assets
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.5
  • WordPress version: 6.3.1
  • First release: Jan 22, 2015
  • Latest release: Jan 26, 2015
  • Number of updates: 10
  • Update frequency: every 0.5 days
  • Top authors: abda53 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /846 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/site-assets/site-assets.php+39
    array_map(): Expected parameter 2 to be an array, null given

Server metrics [RAM: ▼1.97MB] [CPU: ▼61.23ms] Passed 4 tests

Server-side resources used by Site Assets
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.445.42 ▼39.20
Dashboard /wp-admin2.09 ▼1.308.27 ▼63.34
Posts /wp-admin/edit.php2.09 ▼1.316.65 ▼48.92
Add New Post /wp-admin/post-new.php2.09 ▼3.846.90 ▼93.46
Media Library /wp-admin/upload.php2.09 ▼1.195.50 ▼32.13
Site Assets /wp-admin/options-general.php?page=site-assets2.096.94

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Site Assets
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4514.73 ▲0.201.75 ▼0.0247.77 ▲2.05
Dashboard /wp-admin2,201 ▲215.60 ▼0.0792.33 ▼5.6442.76 ▲1.14
Posts /wp-admin/edit.php2,118 ▲181.99 ▼0.0336.04 ▼1.4534.79 ▼0.82
Add New Post /wp-admin/post-new.php1,537 ▲1123.20 ▼0.30647.18 ▼78.1867.35 ▲5.40
Media Library /wp-admin/upload.php1,412 ▲124.17 ▲0.0398.65 ▼15.1340.76 ▼4.86
Site Assets /wp-admin/options-general.php?page=site-assets1,1311.6725.5128.34

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/site-assets/site-assets.php+39
    array_map(): Expected parameter 2 to be an array, null given
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

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=site-assets
    • > Warning in wp-content/plugins/site-assets/site-assets.php+52
    array_map(): Expected parameter 2 to be an array, null given
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=site-assets
    • > Warning in wp-content/plugins/site-assets/site-assets.php+53
    array_intersect(): Expected parameter 1 to be an array, null given
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=site-assets
    • > Warning in wp-content/plugins/site-assets/site-assets.php+54
    count(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/options-general.php?page=site-assets
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script 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 site_assets handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=site-assets
    • > POST request to /wp-cron.php?doing_wp_cron=1697551793.8827230930328369140625
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=site-assets
    • > POST request to /wp-cron.php?doing_wp_cron=1697551793.8827230930328369140625
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(http://www.fillyourtaproom.com/wp-json/wp/v2/posts?per_page=10): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=site-assets
    • > Warning in wp-content/plugins/site-assets/inc/site_assets_admin.php+63
    in_array() expects parameter 2 to be array, null given
    • > GET request to /wp-admin/options-general.php?page=site-assets
    • > Notice in wp-content/plugins/site-assets/inc/site_assets_admin.php+80
    Undefined variable: site_assets_style

SRP 50% from 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
The following issues need your attention
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      require_once(ABSPATHWPINC/pluggable.php): failed to open stream: No such file or directory in wp-content/plugins/site-assets/site-assets.php on line 34
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/site-assets/site-assets.php on line 34
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/site-assets/site-assets.php on line 34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/site-assets/inc/site_assets_view.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/site-assets/inc/site_assets_meta.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/site-assets/inc/site_assets_admin.php:32
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHWPINC/pluggable.php' (include_path='.:/usr/share/php') in wp-content/plugins/site-assets/site-assets.php on line 34

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 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
7 plugin tags: contribution, images, site, media, content...

site-assets/site-assets.php 92% from 13 tests

The entry point to "Site Assets" version 1.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 145 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin426 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP55444305
CSS2196120
JavaScript1051

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
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%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin