57% selfie

Code Review | Selfie

WordPress plugin Selfie scored 57% from 54 tests.

About plugin

  • Plugin page: selfie
  • Plugin version: 0.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.9.1
  • WordPress version: 6.3.1
  • First release: Apr 25, 2014
  • Latest release: Jun 10, 2014
  • Number of updates: 8
  • Update frequency: every 13.0 days
  • Top authors: broadstreetads (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

10+ active / 2,574 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼1.38MB] [CPU: ▼44.17ms] Passed 4 tests

Server-side resources used by Selfie
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.61 ▼0.8517.63 ▼26.04
Dashboard /wp-admin2.62 ▼0.6813.70 ▼36.28
Posts /wp-admin/edit.php2.63 ▼0.7313.40 ▼33.47
Add New Post /wp-admin/post-new.php2.63 ▼3.2612.89 ▼80.88
Media Library /wp-admin/upload.php2.63 ▼0.6015.71 ▼15.89
How To Get Started /wp-admin/admin.php?page=Selfie-Help2.6213.81
Important Tips /wp-admin/admin.php?page=Selfie-Tips2.6213.97
Account Setup /wp-admin/admin.php?page=Selfie2.6212.86

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 62 new files
Database: no new tables, 10 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
Selfie_Installed_0.2.2
widget_selfie_sidebar
can_compress_scripts
Selfie_Installed
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
Selfie_Fake_Post_ID

Browser metrics Passed 4 tests

Checking browser requirements for Selfie
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,873 ▲11613.29 ▼1.112.93 ▲0.9442.22 ▼7.81
Dashboard /wp-admin2,236 ▲484.93 ▲0.05101.71 ▼16.0773.67 ▲25.07
Posts /wp-admin/edit.php2,128 ▲391.99 ▲0.0038.70 ▲2.0436.87 ▲2.54
Add New Post /wp-admin/post-new.php6,497 ▲4,95923.26 ▲0.45927.16 ▲253.2858.24 ▲6.45
Media Library /wp-admin/upload.php1,412 ▲274.21 ▲0.0095.24 ▼9.8363.05 ▲17.12
How To Get Started /wp-admin/admin.php?page=Selfie-Help1,2134.76143.4548.50
Important Tips /wp-admin/admin.php?page=Selfie-Tips1,1484.51127.3435.75
Account Setup /wp-admin/admin.php?page=Selfie2,2226.17149.6161.91

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in Selfie_Zone_Widget is deprecated since version 4.3.0! Use __construct() instead.
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • Selfie_Fake_Post_ID
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_selfie_sidebar
    • widget_recent-posts
    • Selfie_Installed
    • Selfie_Installed_0.2.2
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Selfie
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in Selfie_Zone_Widget is deprecated since version 4.3.0! Use __construct() instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Selfie
    • > User deprecated in wp-includes/functions.php+5747
    Function add_option was called with an argument that is deprecated since version 2.3.0 with no alternative available.

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
Almost there! Just fix the following items
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/selfie/Selfie/Views/ads/themes/cave.php
    • > /wp-content/plugins/selfie/Selfie/Views/ads/themes/metro.php
    • > /wp-content/plugins/selfie/Selfie/Views/ads/selfie.php
    • > /wp-content/plugins/selfie/Selfie/Views/ads/sidebar.php
  • 44× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: likes in wp-content/plugins/selfie/Selfie/Views/ads/themes/metro.php on line 14
    • > PHP Notice
      Undefined variable: post_id in wp-content/plugins/selfie/Selfie/Views/ads/themes/cave.php on line 13
    • > PHP Notice
      Trying to get property 'show_help' of non-object in wp-content/plugins/selfie/Selfie/Views/ads/themes/cave.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'Selfie_View' not found in wp-content/plugins/selfie/Selfie/Views/admin/tips.php:4
    • > PHP Notice
      Undefined variable: zone_id in wp-content/plugins/selfie/Selfie/Views/ads/sidebar.php on line 2
    • > PHP Notice
      Undefined variable: config in wp-content/plugins/selfie/Selfie/Views/ads/selfie.php on line 4
    • > PHP Notice
      Undefined variable: position_id in wp-content/plugins/selfie/Selfie/Views/ads/themes/metro.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/selfie/Selfie/Widgets.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Selfie_View' not found in wp-content/plugins/selfie/Selfie/Views/admin/help.php:4
    • > PHP Notice
      Undefined variable: config in wp-content/plugins/selfie/Selfie/Views/ads/selfie.php on line 3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Selfie
    • > Rendering (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1 The specified value "!" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Selfie
    • > Network (severe)
    https://broadstreetads.com/blog/feed.jsonp/ - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/admin.php?page=Selfie
    • > Network (severe)
    https://connect.facebook.net/en_US/fp.js - Failed to load resource: the server responded with a status of 500 ()
    • > GET request to /wp-admin/admin.php?page=Selfie
    • > Rendering (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === selfie === )
You can look at the official readme.txt

selfie/selfie.php Passed 13 tests

This is the main PHP file of "Selfie" version 0.2.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
66 characters long description:
Native in-post text ads that your readers can purchase themselves.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin5,899 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP225648682,651
JavaScript43732111,983
CSS7153721,265

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity17.79
▷ Minimum class complexity1.00
▷ Maximum class complexity112.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods134
▷ Static methods6447.76%
▷ Public methods12190.30%
▷ Protected methods53.73%
▷ Private methods85.97%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants30
▷ Global constants620.00%
▷ Class constants2480.00%
▷ Public constants24100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
18 PNG files occupy 0.47MB with 0.35MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Selfie/Public/img/help/auto-selfie.png24.07KB7.28KB▼ 69.77%
Selfie/Public/img/marty.png6.43KB2.32KB▼ 63.87%
Selfie/Public/img/help/price-macro-rendered.png46.81KB12.04KB▼ 74.28%
Selfie/Public/img/classified-badge.png3.76KB0.83KB▼ 78.03%
Selfie/Public/img/selfie-badge.png3.29KB0.56KB▼ 83.04%