Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/phpcs #286

Merged
merged 53 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
b184483
Initial PHPCS checks
oscarssanchez Aug 1, 2022
6692501
PHPCBF fixes
oscarssanchez Aug 1, 2022
65171b2
brightcove-video-connect.php phpcs fixes
oscarssanchez Aug 4, 2022
015d546
cli/class-brightcove-cli.php phpcs fixes
oscarssanchez Aug 4, 2022
26a646f
class-bc-admin-media-api.php phpcs fixes
oscarssanchez Aug 4, 2022
3fea880
class-bc-admin-labels-page.php phpcs fixes
oscarssanchez Aug 4, 2022
cf0b1c3
class-bc-admin-menu.php phpcs fixes
oscarssanchez Aug 4, 2022
d7a48b4
class-bc-admin-playlists-page.php phpcs fixes
oscarssanchez Aug 4, 2022
3e70d61
class-bc-admin-settings-page.php
oscarssanchez Aug 4, 2022
3c7f09c
class-bc-admin-sources.php phpcs fixes
oscarssanchez Aug 4, 2022
53ca539
class-bc-admin-user-profile.php phpcs fixes
oscarssanchez Aug 4, 2022
5943efe
class-bc-admin-videos-page.php phpcs fixes
oscarssanchez Aug 4, 2022
d29cde5
class-bc-templates.php phpcs fixes
oscarssanchez Aug 4, 2022
feae4b8
class-bc-api.php phpcs fixes
oscarssanchez Aug 4, 2022
051658b
class-bc-cms-api.php phpcs fixes
oscarssanchez Aug 4, 2022
594c612
class-bc-experiences-api.php phpcs fixes
oscarssanchez Aug 4, 2022
31e1a98
includes/api/class-bc-oauth.php phpcs fixes
oscarssanchez Aug 4, 2022
b2976a1
includes/api/class-bc-player-management-api.php phpcs fixes
oscarssanchez Aug 4, 2022
898975c
includes/api/class-bc-player-management-api2.php phpcs fixes
oscarssanchez Aug 4, 2022
e022ca6
includes/api/class-bc-text-track.php phpcs fixes
oscarssanchez Aug 4, 2022
dad8c04
includes/class-bc-accounts.php phpcs fixes
oscarssanchez Aug 4, 2022
67da919
includes/class-bc-errors.php phpcs fixes
oscarssanchez Aug 4, 2022
df0fd2b
includes/class-bc-experiences-shortcode.php phpcs fixes
oscarssanchez Aug 4, 2022
9808c30
includes/class-bc-in-page-experience-shortcode.php phpcs fixes
oscarssanchez Aug 4, 2022
75d141b
includes/class-bc-labels.php phpcs fixes
oscarssanchez Aug 4, 2022
b196c2e
includes/class-bc-logging.php phpcs fixes
oscarssanchez Aug 4, 2022
e662a3f
includes/class-bc-notification-api.php phpcs fixes
oscarssanchez Aug 4, 2022
0004fcd
includes/class-bc-permissions.php phpcs fixes
oscarssanchez Aug 4, 2022
3888ac5
includes/class-bc-playlist-shortcode.php phpcs fixes
oscarssanchez Aug 4, 2022
e7bf58f
includes/class-bc-setup.php phpcs fixes
oscarssanchez Aug 4, 2022
ef7f50c
includes/class-bc-tags.php phpcs fixes
oscarssanchez Aug 4, 2022
40352ad
includes/class-bc-utility.php phpcs fixes
oscarssanchez Aug 4, 2022
39dc9d9
includes/class-bc-video-shortcode.php phpcs fixes
oscarssanchez Aug 4, 2022
f6ca93b
includes/class-bc-video-upload.php phpcs fixes
oscarssanchez Aug 4, 2022
1728cf2
includes/sync/class-bc-playlists.php phpcs fixes
oscarssanchez Aug 4, 2022
295fc2c
includes/sync/class-bc-videos.php phpcs fixes
oscarssanchez Aug 4, 2022
d01be57
uninstall.php phpcs fixes
oscarssanchez Aug 4, 2022
456df46
Merge branch 'develop' into fix/phpcs
oscarssanchez Aug 4, 2022
82b69f1
Fixes activation error
oscarssanchez Sep 5, 2022
552364b
Fixes bug with old folder ID update
oscarssanchez Sep 5, 2022
db2d1d9
Bump php lint version used
oscarssanchez Sep 21, 2022
db94cfc
Remove unused code
oscarssanchez Sep 21, 2022
1069e77
Align descriptions
oscarssanchez Sep 21, 2022
9158805
Align descriptions
oscarssanchez Sep 21, 2022
ff0df76
Deprecate actions
oscarssanchez Sep 22, 2022
5234eb4
Align docs
oscarssanchez Sep 22, 2022
ae933bc
Specify phpcs rule
oscarssanchez Sep 22, 2022
ab24ae0
Align docs
oscarssanchez Sep 23, 2022
af798f7
Add comma
oscarssanchez Sep 23, 2022
8b6cce4
Remove unused code
oscarssanchez Sep 23, 2022
b261726
Add phpcs rule
oscarssanchez Sep 23, 2022
31b09b8
Deprecate method
oscarssanchez Oct 3, 2022
454cb98
PHPCS fixes
oscarssanchez Oct 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,24 @@ jobs:
- name: npm install
run: npm install
- name: eslint
run: npm run lint-js
run: npm run lint-js

phpcs:
name: PHP Lint
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none

- name: composer install
run: composer install

- name: PHPCS check
run: composer run lint
38 changes: 19 additions & 19 deletions assets/js/brightcove-admin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions assets/js/src/models/media-collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ var MediaCollection = Backbone.Collection.extend({
this.searchTerm = options.searchTerm || '';
this.dates = options.dates || 'all';
this.tag = options.tag || '';
this.folderId = options.folderId || '';
this.oldFolderId = options.oldFolderId || '';
this.folder_id = options.folder_id || '';
this.old_folder_id = options.old_folder_id || '';
this.labelPath = options.labelPath || '';
this.oldLabelPath = options.oldLabelPath || '';

Expand Down Expand Up @@ -85,14 +85,14 @@ var MediaCollection = Backbone.Collection.extend({
this.fetch();
});

this.listenTo(wpbc.broadcast, 'change:folder', function (folderId) {
this.oldFolderId = this.folderId;
this.listenTo(wpbc.broadcast, 'change:folder', function (folder_id) {
this.old_folder_id = this.folder_id;

if (folderId === 'all') {
folderId = '';
if (folder_id === 'all') {
folder_id = '';
}

this.folderId = folderId;
this.folder_id = folder_id;
this.fetch();
});

Expand Down Expand Up @@ -189,8 +189,8 @@ var MediaCollection = Backbone.Collection.extend({
labels: this.labels,
labelPath: this.labelPath,
oldLabelPath: this.oldLabelPath,
oldFolderId: this.oldFolderId,
folderId: this.folderId,
old_folder_id: this.old_folder_id,
folder_id: this.folder_id,
state: this.state,
oldState: this.oldState,
tagName: wpbc.preload.tags[this.tag],
Expand All @@ -205,7 +205,7 @@ var MediaCollection = Backbone.Collection.extend({
'search',
'tags',
'type',
'folderId',
'folder_id',
'tagName',
'state',
);
Expand Down
4 changes: 2 additions & 2 deletions assets/js/src/models/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ var MediaModel = Backbone.Model.extend({
name: this.get('name'),
nonce: wpbc.preload.nonce,
tags: this.get('tags'),
oldFolderId: this.get('oldFolderId'),
folderId: this.get('folderId'),
old_folder_id: this.get('old_folder_id'),
folder_id: this.get('folder_id'),
type: this.get('mediaType'),
custom_fields: this.get('custom_fields'),
history: this.get('_change_history'),
Expand Down
4 changes: 2 additions & 2 deletions assets/js/src/views/brightcove-media-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ var BrightcoveMediaManagerView = BrightcoveView.extend({

this.listenTo(wpbc.broadcast, 'change:folder', function (folder) {
this.clearPreview();
this.model.set('oldFolderId', this.model.get('folderId'));
this.model.set('folderId', folder);
this.model.set('old_folder_id', this.model.get('folder_id'));
this.model.set('folder_id', folder);
});

this.listenTo(wpbc.broadcast, 'change:label', function (labelPath) {
Expand Down
6 changes: 3 additions & 3 deletions assets/js/src/views/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var ToolbarView = BrightcoveView.extend({
folders: wpbc.preload.folders,
labels: wpbc.preload.labels,
labelPath: this.model.get('labelPath'),
folderId: this.model.get('folderId'),
folder_id: this.model.get('folder_id'),
account: this.model.get('account'),
};

Expand Down Expand Up @@ -108,8 +108,8 @@ var ToolbarView = BrightcoveView.extend({
},

foldersChanged: function (event) {
this.model.set('oldFolderId', this.model.get('folderId'));
this.model.set('folderId', event.target.value);
this.model.set('old_folder_id', this.model.get('folder_id'));
this.model.set('folder_id', event.target.value);
wpbc.broadcast.trigger('change:folder', event.target.value);
},

Expand Down
4 changes: 2 additions & 2 deletions assets/js/src/views/video-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ var VideoEditView = BrightcoveView.extend({
this.model.set('width', this.$el.find('.brightcove-width').val());
this.model.set('poster', this.$el.find('.brightcove-poster').val());
this.model.set('thumbnail', this.$el.find('.brightcove-thumbnail').val());
this.model.set('folderId', this.$el.find('.brightcove-folder').val());
this.model.set('folder_id', this.$el.find('.brightcove-folder').val());

const isVariant = this.$el.find('.brightcove-variant').val();

Expand Down Expand Up @@ -585,7 +585,7 @@ var VideoEditView = BrightcoveView.extend({
// Due to a change in the API response, text_tracks might not be defined if the video lacks text_tracks.
options.text_tracks = options.text_tracks || [];

this.model.set('oldFolderId', options.folder_id);
this.model.set('old_folder_id', options.folder_id);

// Render the model into the template
this.$el.html(this.template(options));
Expand Down
6 changes: 3 additions & 3 deletions brightcove-video-connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* License: GPLv2+
* Text Domain: brightcove
* Domain Path: /languages
*
* @package Brightcove_Video_Connect
*/

/**
Expand Down Expand Up @@ -72,7 +74,7 @@ function brightcove_deactivate() {

// Wireup actions.
if ( is_admin() ) {
add_action( 'admin_notices', array( 'BC_Setup', 'bc_admin_notices' ) );
add_action( 'admin_notices', array( 'BC_Setup', 'bc_admin_notices' ) );
}

add_action( 'init', array( 'BC_Setup', 'action_init' ) );
Expand All @@ -83,8 +85,6 @@ function brightcove_deactivate() {
add_action( 'init', array( 'BC_Setup', 'action_init_all' ), 9 ); // Ensures the menu is loaded on all pages.
add_action( 'init', array( 'BC_Notification_API', 'setup' ), 9 );

// add_action( 'brightcove_upgrade', array( 'BC_Notification_API', 'maybe_backport_subscriptions' ) ); // @TODO Verify API as errors don't seem to match the documentation

if ( ! defined( 'WPCOM_IS_VIP_ENV' ) || ! WPCOM_IS_VIP_ENV ) {

// Activation / Deactivation.
Expand Down
5 changes: 5 additions & 0 deletions cli/class-brightcove-cli.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* Brightcove WP CLI commands file.
*
* @package Brightcove_Video_Connect
*/

/**
* Implements a set of commands to interact with the Brightcove Video Connect plugin
Expand Down
8 changes: 4 additions & 4 deletions developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ While the plugin itself will function on a local or firewalled machine, some ope

The brightcove plugin uses these hooks internally when rendering out plugin pages. Developers can add content via these hooks, augmenting the existing admin pages.

* `brightcove/admin/settings_page`: Fires when the setting page loads.
* `brightcove/admin/videos_page`: Fires when the videos page loads.
* `brightcove/admin/playlists_page`: Fires when the playlist page loads.
* `brightcove/admin/edit_source_page`: Fires when the edit source page loads.
* `brightcove_admin_settings_page`: Fires when the setting page loads.
* `brightcove_admin_videos_page`: Fires when the videos page loads.
* `brightcove_admin_playlists_page`: Fires when the playlist page loads.
* `brightcove_admin_edit_source_page`: Fires when the edit source page loads.

## JavaScript architecture

Expand Down
Loading