68% rep-u-press-social-analytics

Code Review | Rep U Press Social Media Analytics

WordPress plugin Rep U Press Social Media Analytics scored68%from 54 tests.

About plugin

  • Plugin page: rep-u-press-socia...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.4.1
  • WordPress version: 6.3.1
  • First release: Jan 29, 2016
  • Latest release: Jan 30, 2016
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: repupress (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,002 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.37ms] Passed 4 tests

An overview of server-side resources used by Rep U Press Social Media Analytics
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.53 ▲4.00
Dashboard /wp-admin3.35 ▲0.0148.21 ▼14.01
Posts /wp-admin/edit.php3.47 ▲0.1153.97 ▲11.71
Add New Post /wp-admin/post-new.php5.93 ▲0.0580.14 ▼16.90
Media Library /wp-admin/upload.php3.27 ▲0.0535.27 ▲1.42
Social Analytics /wp-admin/admin.php?page=social-analytics3.3130.55
Social Premium /wp-admin/admin.php?page=repupress-socail-media-analytics-premium3.2632.72
RepUPress SA /wp-admin/admin.php?page=social-media-analytics-share-buttons3.2628.65
Email Settings /wp-admin/admin.php?page=email-settings3.2731.67

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 42 new files
Database: 1 new table, 8 new options
New tables
wp_posts_social
New WordPress options
can_compress_scripts
smaasb_db_version
theysaidso_admin_options
widget_recent-comments
smaasb_settings
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Rep U Press Social Media Analytics
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲9313.24 ▼1.141.83 ▲0.1642.22 ▼0.08
Dashboard /wp-admin2,245 ▲535.83 ▲0.90107.03 ▼0.4248.16 ▲10.30
Posts /wp-admin/edit.php2,152 ▲602.05 ▲0.0237.84 ▼2.1232.14 ▼1.71
Add New Post /wp-admin/post-new.php1,564 ▲5023.33 ▲5.81661.38 ▲40.0865.45 ▲11.72
Media Library /wp-admin/upload.php1,424 ▲364.28 ▲0.0595.44 ▼4.0742.75 ▼0.98
Social Analytics /wp-admin/admin.php?page=social-analytics2,6173.2171.1661.75
Social Premium /wp-admin/admin.php?page=repupress-socail-media-analytics-premium8171.8522.1924.03
RepUPress SA /wp-admin/admin.php?page=social-media-analytics-share-buttons8182.0826.5444.86
Email Settings /wp-admin/admin.php?page=email-settings8422.0223.4228.24

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
The following items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_posts_social
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • smaasb_settings
    • widget_theysaidso_widget
    • db_upgraded
    • smaasb_db_version
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/rep-u-press-social-analytics/views/layout.php
    • > /wp-content/plugins/rep-u-press-social-analytics/repupress-socail-media-analytics-premium.php
    • > /wp-content/plugins/rep-u-press-social-analytics/views/dashboard/popup.view.php
  • 32× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/rep-u-press-social-analytics/repupress-social-media-analytics.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/rep-u-press-social-analytics/modules/statistics/social_shortcode.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Smaasb_Service_Interface' not found in wp-content/plugins/rep-u-press-social-analytics/modules/statistics/services/facebook.php:5
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/rep-u-press-social-analytics/views/dashboard/popup.view.php on line 26
    • > PHP Notice
      Trying to get property 'linkedin' of non-object in wp-content/plugins/rep-u-press-social-analytics/views/dashboard/popup.view.php on line 26
    • > PHP Warning
      include(): Failed opening '' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/rep-u-press-social-analytics/views/layout.php on line 3
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/rep-u-press-social-analytics/views/settings/settings.view.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'Smaasb_Module_Admin' not found in wp-content/plugins/rep-u-press-social-analytics/modules/settings/settings.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/rep-u-press-social-analytics/views/settings/settings.view.php:4
    • > PHP Notice
      Undefined variable: post_title in wp-content/plugins/rep-u-press-social-analytics/views/dashboard/popup.view.php on line 5

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)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 16 tag instead of maximum 10
The official readme.txt might help

rep-u-press-social-analytics/wp-repupress-social media.php 85% from 13 tests

This is the main PHP file of "Rep U Press Social Media Analytics" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("rep-u-press-social-analytics.php" instead of "wp-repupress-social media.php")
  • Description: The description should be shorter than 140 characters (currently 210 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
There were no executable files found in this plugin1,855 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP283124981,226
CSS2196306
LESS3554200
HTML1282105
JavaScript11318

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity6.00
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes17
▷ Abstract classes15.88%
▷ Concrete classes1694.12%
▷ Final classes00.00%
Methods69
▷ Static methods811.59%
▷ Public methods5681.16%
▷ Protected methods34.35%
▷ Private methods1014.49%
Functions19
▷ Named functions1473.68%
▷ Anonymous functions526.32%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
6 PNG files occupy 0.20MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png68.75KB25.51KB▼ 62.89%
assets/banner-772x250.png21.28KB8.58KB▼ 59.67%
assets/screenshot-2.png8.25KB4.06KB▼ 50.79%
assets/icon-256x256.png24.02KB9.16KB▼ 61.87%
assets/icon-128x128.png9.57KB4.19KB▼ 56.26%