79% safe-function-call

Code Review | Safe Function Call

WordPress plugin Safe Function Call scored79%from 54 tests.

About plugin

  • Plugin page: safe-function-call
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 1.5-6.3
  • WordPress version: 6.3.1
  • First release: Jun 11, 2009
  • Latest release: Aug 22, 2023
  • Number of updates: 28
  • Update frequency: every 185.7 days
  • Top authors: coffee2code (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,572 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
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.05ms] Passed 4 tests

This is a short check of server-side resources used by Safe Function Call
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.47 ▼2.48
Dashboard /wp-admin3.31 ▲0.0154.02 ▲1.68
Posts /wp-admin/edit.php3.36 ▲0.0149.14 ▼1.35
Add New Post /wp-admin/post-new.php5.89 ▲0.0199.86 ▼7.66
Media Library /wp-admin/upload.php3.23 ▲0.0136.86 ▼0.72

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Safe Function Call
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.29 ▼1.081.84 ▼0.5243.24 ▼0.55
Dashboard /wp-admin2,206 ▲185.83 ▲0.9895.57 ▼21.5641.90 ▼1.27
Posts /wp-admin/edit.php2,086 ▼32.03 ▼0.0235.11 ▼4.4335.75 ▼0.42
Add New Post /wp-admin/post-new.php1,533 ▲1423.20 ▲0.22636.57 ▼44.4166.70 ▲6.20
Media Library /wp-admin/upload.php1,388 ▼04.23 ▲0.1093.88 ▼26.2641.02 ▼5.77

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/safe-function-call/tests/phpunit/bootstrap.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/safe-function-call/safe-function-call.php:83
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/tests/phpunit/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/safe-function-call/tests/phpunit/bootstrap.php on line 29
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/tests/phpunit/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/safe-function-call/tests/phpunit/bootstrap.php on line 29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: plugin, error, coffee2code, function, template

safe-function-call/safe-function-call.php Passed 13 tests

The main file in "Safe Function Call" v. 1.3.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
118 characters long description:
Safely and easily call functions that may not be available (such as those provided by a plugin that gets deactivated).

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin505 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
Markdown41090257
PHP466127213
Bourne Shell16221
XML10014

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.07
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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 files were detected