77% news-magazine-and-blog-elements

Code Review | News, Magazine and Blog Elements

WordPress plugin News, Magazine and Blog Elements scored 77% from 54 tests.

About plugin

  • Plugin page: news-magazine-and...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9.5
  • WordPress version: 6.3.1
  • First release: Sep 18, 2017
  • Latest release: Apr 4, 2018
  • Number of updates: 18
  • Update frequency: every 11.1 days
  • Top authors: athemeart (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active / 8,203 total downloads

Benchmarks

Plugin footprint 83% 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: ▲1.36MB] [CPU: ▲9.59ms] Passed 4 tests

Server-side resources used by News, Magazine and Blog Elements
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.61 ▲1.1647.45 ▲7.02
Dashboard /wp-admin4.88 ▲1.5860.50 ▲11.72
Posts /wp-admin/edit.php4.89 ▲1.5464.78 ▲10.98
Add New Post /wp-admin/post-new.php7.10 ▲1.2299.65 ▲8.96
Media Library /wp-admin/upload.php4.77 ▲1.5446.03 ▲11.40

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 97 new files
Database: no new tables, 15 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_eds_news_list_extended
ata_news_color_scheme
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
ata_news_typography
widget_eds_news_slider_extended
widget_eds_news_block_extended
...

Browser metrics Passed 4 tests

An overview of browser requirements for News, Magazine and Blog Elements
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,170 ▲43515.91 ▲1.6221.38 ▲19.7065.22 ▲23.30
Dashboard /wp-admin2,399 ▲2136.60 ▲0.71133.06 ▲30.8846.08 ▲5.04
Posts /wp-admin/edit.php2,308 ▲2193.51 ▲1.5256.80 ▲20.3337.12 ▲3.28
Add New Post /wp-admin/post-new.php4,965 ▲3,44623.40 ▲0.09628.18 ▼82.5634.72 ▼32.67
Media Library /wp-admin/upload.php1,447 ▲564.30 ▲0.0781.86 ▼21.1442.80 ▼3.76

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 15 options in the database
    • widget_recent-comments
    • widget_eds_news_carsoul_extended
    • widget_eds_news_slider_extended
    • db_upgraded
    • widget_eds_news_list_extended
    • widget_recent-posts
    • widget_eds_news_ticker_extended
    • widget_eds_news_block_extended
    • ata_news_color_scheme
    • theysaidso_admin_options
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/news-magazine-and-blog-elements/inc/vc_map.php
  • 12× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ATA_VAR_URL - assumed 'ATA_VAR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/news-magazine-and-blog-elements/vendors/ata-shortcodes/athemeart-shortcodes.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/news-magazine-and-blog-elements/vendors/widgets-helper/class-widget-helper.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_template_directory() in wp-content/plugins/news-magazine-and-blog-elements/vendors/widgets-helper/widget-helper.php:9
    • > PHP Notice
      Undefined variable: html in wp-content/plugins/news-magazine-and-blog-elements/templates/post_carsoul_style_1.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ATA_VAR_PATH/vendors/ata-shortcodes/includes/shortcodes.php' (include_path='.:/usr/share/php') in wp-content/plugins/news-magazine-and-blog-elements/vendors/ata-shortcodes/athemeart-shortcodes.php on line 19
    • > PHP Warning
      require_once(ATA_VAR_PATH/vendors/ata-shortcodes/includes/shortcodes.php): failed to open stream: No such file or directory in wp-content/plugins/news-magazine-and-blog-elements/vendors/ata-shortcodes/athemeart-shortcodes.php on line 19
    • > PHP Warning
      Use of undefined constant ATA_VAR_PATH - assumed 'ATA_VAR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/news-magazine-and-blog-elements/vendors/ata-shortcodes/athemeart-shortcodes.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/news-magazine-and-blog-elements/templates/post_carsoul_style_1.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/news-magazine-and-blog-elements/vendors/ata-shortcodes/includes/config.php:16
    • > PHP Notice
      Undefined variable: the_query in wp-content/plugins/news-magazine-and-blog-elements/templates/post_carsoul_style_1.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 errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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:
  • Screenshots: These screenshots require images: #1 (Visual Composer Addons), #2 (Page Builder by SiteOrigin Addons), #3 (Widgets), #4 (Shortcode generator)
  • Tags: Please delete some tags, you are using 16 tag instead of maximum 10
Please take inspiration from this readme.txt

news-magazine-and-blog-elements/news_magazine_and_blog_elements.php 85% from 13 tests

The primary PHP file in "News, Magazine and Blog Elements" version 1.3 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("news-magazine-and-blog-elements.php" instead of "news_magazine_and_blog_elements.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 291 characters long)

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
Everything looks great! No dangerous files found in this plugin33,527 lines of code in 77 files:
LanguageFilesBlank linesComment linesLines of code
CSS161,28912613,359
PHP201,7931,3057,332
JavaScript101,7242,0196,444
SVG1002,671
Sass1434341,768
LESS1434441,758
Markdown2680195

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity17.24
▷ Minimum class complexity1.00
▷ Maximum class complexity75.00
Average method complexity4.33
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods83
▷ Static methods11.20%
▷ Public methods7691.57%
▷ Protected methods44.82%
▷ Private methods33.61%
Functions76
▷ Named functions76100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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
11 PNG files occupy 0.15MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/icon.png1.25KB0.68KB▼ 46.02%
screenshot-4.png55.78KB30.14KB▼ 45.96%
vendors/ata-shortcodes/assets/img/toggle-open.png0.10KB0.12KB0.00%
screenshot-3.png8.34KB5.42KB▼ 34.96%
assets/img/greyline.png1.67KB0.13KB▼ 92.38%