77% newsmanapp

Code Review | NewsmanApp

WordPress plugin NewsmanApp scored77%from 54 tests.

About plugin

  • Plugin page: newsmanapp
  • Plugin version: 2.6.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.1-6.4.1
  • WordPress version: 6.3.1
  • First release: Jul 27, 2015
  • Latest release: Nov 27, 2023
  • Number of updates: 123
  • Update frequency: every 24.8 days
  • Top authors: newsmanapp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /7,372 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.18MB] [CPU: ▼1.95ms] Passed 4 tests

A check of server-side resources used by NewsmanApp
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1838.72 ▼2.11
Dashboard /wp-admin3.49 ▲0.1549.22 ▼11.94
Posts /wp-admin/edit.php3.61 ▲0.2550.64 ▲5.89
Add New Post /wp-admin/post-new.php6.09 ▲0.2194.92 ▲1.65
Media Library /wp-admin/upload.php3.42 ▲0.1936.32 ▲4.61
Widget /wp-admin/admin.php?page=NewsmanWidget3.3832.84
SMS /wp-admin/admin.php?page=NewsmanSMS3.5034.08
Oauth /wp-admin/admin.php?page=NewsmanOauth3.4233.18
Remarketing /wp-admin/admin.php?page=NewsmanRemarketing3.3930.96
Settings /wp-admin/admin.php?page=NewsmanSettings3.4332.58
Newsman /wp-admin/admin.php?page=Newsman3.3829.19
Sync /wp-admin/admin.php?page=NewsmanSync3.4331.57

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 35 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for NewsmanApp
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,867 ▲12014.69 ▲0.591.77 ▲0.0839.91 ▼4.69
Dashboard /wp-admin2,233 ▲565.54 ▼0.3094.73 ▼5.1875.01 ▲29.70
Posts /wp-admin/edit.php2,153 ▲501.99 ▲0.0539.09 ▲0.4534.20 ▼3.52
Add New Post /wp-admin/post-new.php1,569 ▲4323.37 ▲0.34615.27 ▼45.6556.00 ▲1.67
Media Library /wp-admin/upload.php1,447 ▲474.22 ▼0.0194.97 ▼1.6671.07 ▲29.26
Widget /wp-admin/admin.php?page=NewsmanWidget9112.0329.3026.08
SMS /wp-admin/admin.php?page=NewsmanSMS1,3691.9025.1330.74
Oauth /wp-admin/admin.php?page=NewsmanOauth9222.0227.0325.15
Remarketing /wp-admin/admin.php?page=NewsmanRemarketing9292.0727.1427.83
Settings /wp-admin/admin.php?page=NewsmanSettings1,0762.2126.7024.91
Newsman /wp-admin/admin.php?page=Newsman9932.2126.2225.96
Sync /wp-admin/admin.php?page=NewsmanSync1,0222.0825.8628.79

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=NewsmanSync
    • > Warning in wp-includes/pluggable.php+1438
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)
    • > GET request to /wp-admin/admin.php?page=NewsmanSync
    • > Notice in wp-content/plugins/newsmanapp/src/backend-sync.php+131
    Undefined variable: available_lists
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=NewsmanSync
    • > Warning in wp-content/plugins/newsmanapp/src/backend-sync.php+169
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=NewsmanSync
    • > Notice in wp-content/plugins/newsmanapp/src/backend-sync.php+150
    Undefined variable: available_smslists
    • > GET request to /wp-admin/admin.php?page=NewsmanSync
    • > Notice in wp-content/plugins/newsmanapp/src/backend-sync.php+169
    Undefined variable: available_segments

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
Almost there! Just fix the following items
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/newsmanapp/src/backend-oauth.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/newsmanapp/src/backend-sms.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/newsmanapp/src/backend.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/newsmanapp/src/backend-remarketing.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/newsmanapp/src/backend-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/newsmanapp/src/frontend.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/newsmanapp/src/backend-sync.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/newsmanapp/newsman_widget.php:4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/newsmanapp/src/backend-settings.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 80% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Donate link: Please fix this invalid url: ""
The official readme.txt might help

newsmanapp/wc-newsman-remarketing.php 62% from 13 tests

"NewsmanApp" version 2.6.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages/")
  • Main file name: Name the main plugin file the same as the plugin slug ("newsmanapp.php" instead of "wc-newsman-remarketing.php")
  • Requires at least: The required version number did not match the one declared in readme.txt ("3.7" instead of "2.1")
  • Domain Path: The domain path should be prefixed with a forward slash character ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected3,364 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP166886223,090
CSS1252109
JavaScript183385104
Markdown153061

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity26.33
▷ Minimum class complexity1.00
▷ Maximum class complexity135.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods114
▷ Static methods1311.40%
▷ Public methods10793.86%
▷ Protected methods43.51%
▷ Private methods32.63%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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
10 PNG files occupy 0.57MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/wp_sms.png71.46KB25.07KB▼ 64.91%
assets/wp_newsman_widget.png26.04KB8.05KB▼ 69.07%
assets/wp_activation.png27.92KB12.25KB▼ 56.13%
src/img/newsman-mini.png1.39KB0.82KB▼ 40.73%
assets/wp_sync.png72.98KB25.58KB▼ 64.95%