10% profile-field-based-content-shortcode

Code Review | Profile field based content shortcode

WordPress plugin Profile field based content shortcode scored10%from 54 tests.

About plugin

  • Plugin page: profile-field-bas...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.6.1
  • WordPress version: 6.3.1
  • First release: Feb 5, 2017
  • Latest release: Feb 5, 2017
  • Number of updates: 5
  • Update frequency: every 4.0 days
  • Top authors: alexhal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /604 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
These installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Profile_Field_Based_Content::activate() should not be called statically

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

An overview of server-side resources used by Profile field based content shortcode
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0140.73 ▼4.83
Dashboard /wp-admin3.32 ▲0.0247.98 ▼3.70
Posts /wp-admin/edit.php3.37 ▲0.0151.24 ▼2.31
Add New Post /wp-admin/post-new.php5.90 ▲0.0285.68 ▼11.83
Media Library /wp-admin/upload.php3.24 ▲0.0140.68 ▲2.97

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Profile field based content shortcode
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.66 ▼1.111.81 ▼0.4341.14 ▼6.45
Dashboard /wp-admin2,215 ▲95.83 ▲0.9299.82 ▼3.3237.68 ▼4.04
Posts /wp-admin/edit.php2,100 ▼01.99 ▲0.0243.51 ▲1.2537.10 ▲1.02
Add New Post /wp-admin/post-new.php1,545 ▼023.22 ▲0.05663.50 ▲48.8475.81 ▲6.92
Media Library /wp-admin/upload.php1,400 ▼04.45 ▲0.22113.69 ▲2.9948.77 ▲2.06

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Profile_Field_Based_Content::deactivate() should not be called statically
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/profile-field-based-content-shortcode/profile-field-based-content-bp.php:36

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

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === profile-field-based-content-shortcode === )
You can take inspiration from this readme.txt

profile-field-based-content-shortcode/profile-field-based-content-bp.php 92% from 13 tests

The primary PHP file in "Profile field based content shortcode" version 1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("profile-field-based-content-shortcode.php" instead of "profile-field-based-content-bp.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
Good job! No executable or dangerous file extensions detected58 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2212558

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.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
2 PNG files occupy 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png59.75KB21.34KB▼ 64.28%
assets/banner-772x250.png24.19KB8.93KB▼ 63.08%