72% yasham-live-feed

Code Review | Yasham Live Feed

WordPress plugin Yasham Live Feed scored72%from 54 tests.

About plugin

  • Plugin page: yasham-live-feed
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-5.4.1
  • WordPress version: 6.3.1
  • First release: May 1, 2020
  • Latest release: May 1, 2020
  • Number of updates: 5
  • Update frequency: every 0.4 days
  • Top authors: mohamadkhalaf (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /372 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

Analyzing server-side resources used by Yasham Live Feed
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.09 ▼3.80
Dashboard /wp-admin3.32 ▲0.0253.03 ▼3.01
Posts /wp-admin/edit.php3.37 ▲0.0250.27 ▼1.64
Add New Post /wp-admin/post-new.php5.90 ▲0.0188.18 ▼21.43
Media Library /wp-admin/upload.php3.24 ▲0.0137.90 ▼1.89
Add Feed /wp-admin/admin.php?page=add_feed3.1930.58
Settings /wp-admin/admin.php?page=settings_feed3.1934.48

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 7 new options
New WordPress options
yslf_yasham_livefeed_settings
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Yasham Live Feed: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,993 ▲24714.96 ▲0.5823.56 ▲21.8041.80 ▼3.70
Dashboard /wp-admin2,247 ▲505.90 ▲1.00101.53 ▼3.8938.47 ▼3.87
Posts /wp-admin/edit.php2,123 ▲232.00 ▼0.0437.06 ▲1.0933.22 ▼3.48
Add New Post /wp-admin/post-new.php1,564 ▲1923.30 ▼0.08601.67 ▼107.1066.47 ▲3.54
Media Library /wp-admin/upload.php1,426 ▲264.21 ▼0.02108.11 ▼3.5444.88 ▼3.44
Add Feed /wp-admin/admin.php?page=add_feed1,3817.32145.2155.97
Settings /wp-admin/admin.php?page=settings_feed8732.1626.3031.73

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • db_upgraded
    • yslf_yasham_livefeed_settings
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=settings_feed
    • > Notice in wp-content/plugins/yasham-live-feed/includes/feedsettings.php+84
    Trying to access array offset on value of type bool

SRP 50% 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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/yasham-live-feed/yasham-livefeed.php:11

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=add_feed
    • > Console-api (severe) in unknown
    https://www.gstatic.com/firebasejs/7.8.2/firebase-database.js?ver=7 0:11374 "[2023-10-13T21:36:54.037Z] @firebase/database:" "FIREBASE FATAL ERROR: Cannot parse Firebase url. Please use https://\u003CYOUR FIREBASE>.firebaseio.com "
    • > GET request to /wp-admin/admin.php?page=add_feed
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught Error: FIREBASE FATAL ERROR: Cannot parse Firebase url. Please use https://.firebaseio.com
    • > GET request to /wp-admin/admin.php?page=settings_feed
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).wpColorPicker is not a function" "TypeError: $(...).wpColorPicker is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=settings_feed:154:30)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=settings_feed
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).wpColorPicker is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: There are too many tags (12 tag instead of maximum 10)
The official readme.txt might help

yasham-live-feed/yasham-livefeed.php 92% from 13 tests

The entry point to "Yasham Live Feed" version 1.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("yasham-live-feed.php" instead of "yasham-livefeed.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin531 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP44021256
JavaScript21322111
CSS22077
PO File1232365
SVG10022

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.07
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%
Functions11
▷ Named functions1090.91%
▷ Anonymous functions19.09%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
12 PNG files occupy 3.17MB with 2.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screens/11.png76.71KB30.53KB▼ 60.19%
screens/5.png441.63KB109.71KB▼ 75.16%
screens/9.png168.88KB53.30KB▼ 68.44%
screens/8.png123.76KB41.03KB▼ 66.85%
screens/2.png351.08KB130.59KB▼ 62.80%