72% newsgram

Code Review | Newsgram

WordPress plugin Newsgram scored72%from 54 tests.

About plugin

  • Plugin page: newsgram
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.2
  • WordPress version: 6.3.1
  • First release: Jun 3, 2017
  • Latest release: Jun 3, 2017
  • Number of updates: 3
  • Update frequency: every 4.3 days
  • Top authors: Pigrecolab (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /800 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼6.36ms] Passed 4 tests

Analyzing server-side resources used by Newsgram
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.06 ▼5.32
Dashboard /wp-admin3.37 ▲0.0347.99 ▼19.96
Posts /wp-admin/edit.php3.49 ▲0.1349.40 ▼0.62
Add New Post /wp-admin/post-new.php5.96 ▲0.0798.08 ▲0.45
Media Library /wp-admin/upload.php3.30 ▲0.0738.41 ▲2.93
Newsgram settings /wp-admin/options-general.php?page=nwg-settings-admin3.2934.90
Newsgrams /wp-admin/edit.php?post_type=newsgram3.3133.61
Add New /wp-admin/post-new.php?post_type=newsgram3.3038.34

Server storage [IO: ▲0.68MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Just a few items left to fix
  • You have illegally modified 1 file (0.00KB) outside of "wp-content/plugins/newsgram/" and "wp-content/uploads/"
    • (new file) wp-content/plugins/log.txt
Filesystem: 66 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Newsgram
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲7714.72 ▲0.171.86 ▲0.1043.93 ▼3.20
Dashboard /wp-admin2,229 ▲555.82 ▲0.1783.70 ▼10.6039.09 ▼3.34
Posts /wp-admin/edit.php2,131 ▲312.03 ▲0.0241.19 ▲1.2037.68 ▼0.41
Add New Post /wp-admin/post-new.php1,554 ▲2822.96 ▼0.60650.94 ▼32.9259.67 ▲7.94
Media Library /wp-admin/upload.php1,434 ▲344.17 ▼0.03101.28 ▼13.6943.19 ▼6.26
Newsgram settings /wp-admin/options-general.php?page=nwg-settings-admin9961.8131.6530.87
Newsgrams /wp-admin/edit.php?post_type=newsgram1,1141.9533.6130.53
Add New /wp-admin/post-new.php?post_type=newsgram1,9466.52137.2448.84

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=newsgram
    • > Notice in wp-content/plugins/newsgram/newsgram.php+130
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/newsgram/admin-parts/tab-footer.php
    • > /wp-content/plugins/newsgram/admin-parts/sidebar.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/post-new.php?post_type=newsgram
    • > 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: $(...).live is not a function" "TypeError: $(...).live is not a function\n at Object.hooks (/wp-content/plugins/newsgram/meta-box-class/js/meta-box.js:193:73)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/newsgram/meta-box-class/js/meta-box.js:338:20)\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/post-new.php?post_type=newsgram
    • > 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: $(...).live is not a function

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: channel, telegram, bot, messages, newsletter

newsgram/newsgram.php Passed 13 tests

Analyzing the main PHP file in "Newsgram" version 1.0
50 characters long description:
Send messages like newsletter to Telegram Channel.

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 plugin9,873 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript107847887,016
PHP74111,0651,457
CSS71611011,024
PO File7119129376

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity73.00
▷ Minimum class complexity7.00
▷ Maximum class complexity251.00
Average method complexity3.55
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods113
▷ Static methods10.88%
▷ Public methods11299.12%
▷ Protected methods00.00%
▷ Private methods10.88%
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
21 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
meta-box-class/js/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
meta-box-class/images/add.png0.12KB0.12KB▼ 0.81%
meta-box-class/images/move.png0.26KB0.26KB0.00%
meta-box-class/images/delete-16.png1.74KB0.90KB▼ 48.23%
meta-box-class/js/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%