Skip to content

Commit

Permalink
Merge pull request #1081 from publishpress/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
htmgarcia authored Oct 6, 2022
2 parents 15a5ca1 + f441e6a commit 48962d3
Show file tree
Hide file tree
Showing 24 changed files with 4,829 additions and 4,778 deletions.
4 changes: 2 additions & 2 deletions src/advanced-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: PublishPress Blocks
* Plugin URI: https://publishpress.com/blocks/
* Description: PublishPress Blocks has everything you need to build professional websites with the Gutenberg editor.
* Version: 3.0.0
* Version: 3.0.1
* Tested up to: 6.0.2
* Author: PublishPress
* Author URI: https://publishpress.com/
Expand Down Expand Up @@ -56,7 +56,7 @@
if (! defined('ADVANCED_GUTENBERG_LOADED')) {

if (! defined('ADVANCED_GUTENBERG_VERSION')) {
define('ADVANCED_GUTENBERG_VERSION', '3.0.0');
define('ADVANCED_GUTENBERG_VERSION', '3.0.1');
}

if (! defined('ADVANCED_GUTENBERG_PLUGIN')) {
Expand Down
2 changes: 1 addition & 1 deletion src/assets/blocks/advvideo/block.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
</BlockControls>
}
<InspectorControls>
<PanelBody title={ __( 'Advanced Video Settings', 'advanced-gutenberg' ) }>
<PanelBody title={ __( 'Video Settings', 'advanced-gutenberg' ) }>
<ToggleControl
label={ __( 'Open video in light box', 'advanced-gutenberg' ) }
help={ __( 'Lightbox offers additional display options.', 'advanced-gutenberg' ) }
Expand Down
37 changes: 17 additions & 20 deletions src/assets/blocks/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -14283,7 +14283,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
null,
React.createElement(
PanelBody,
{ title: __('Advanced Video Settings', 'advanced-gutenberg') },
{ title: __('Video Settings', 'advanced-gutenberg') },
React.createElement(ToggleControl, {
label: __('Open video in light box', 'advanced-gutenberg'),
help: __('Lightbox offers additional display options.', 'advanced-gutenberg'),
Expand Down Expand Up @@ -16616,13 +16616,12 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
React.createElement(
"p",
{ style: { fontStyle: 'italic' } },
__('We strongly recommend to enable Google reCaptcha to avoid spam bot. You can enable it in Form Recaptcha in', 'advanced-gutenberg'),
__('We strongly recommend to enable Google reCAPTCHA to avoid spam.', 'advanced-gutenberg'),
React.createElement("br", null),
React.createElement(
"a",
{ href: advgbBlocks.config_url + '#email-form', target: "_blank" },
" ",
__('settings', 'advanced-gutenberg'),
"."
{ href: advgbBlocks.config_url + '&tab=recaptcha', target: "_blank" },
__('You can enable it in Settings', 'advanced-gutenberg')
)
)
),
Expand All @@ -16635,7 +16634,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
__('An email will be sent to the admin email (by default) whenever a contact form is submitted. You can change it in ', 'advanced-gutenberg'),
React.createElement(
"a",
{ href: advgbBlocks.config_url + '#settings', target: "_blank" },
{ href: advgbBlocks.config_url + '&tab=forms', target: "_blank" },
" ",
__('settings', 'advanced-gutenberg'),
"."
Expand Down Expand Up @@ -21504,14 +21503,13 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
{ title: __('Notice', 'advanced-gutenberg') },
React.createElement(
"p",
{ style: { fontStyle: 'italic', color: '#ff8800' } },
__('We strongly recommend to enable Google reCaptcha to avoid spam bot. You can enable it in Form Recaptcha in', 'advanced-gutenberg'),
{ style: { fontStyle: 'italic' } },
__('We strongly recommend to enable Google reCAPTCHA to avoid spam.', 'advanced-gutenberg'),
React.createElement("br", null),
React.createElement(
"a",
{ href: advgbBlocks.config_url + '#email-form', target: "_blank" },
" ",
__('settings', 'advanced-gutenberg'),
"."
{ href: advgbBlocks.config_url + '&tab=recaptcha', target: "_blank" },
__('You can enable it in Settings', 'advanced-gutenberg')
)
)
)
Expand Down Expand Up @@ -23343,9 +23341,9 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
"a",
{ target: "_blank",
className: "button button-large",
href: advgbBlocks.config_url + '#settings'
href: advgbBlocks.config_url + '&tab=maps'
},
__('Add Google API Key', 'advanced-gutenberg')
__('Add Google API Key in Settings', 'advanced-gutenberg')
)
)
);
Expand Down Expand Up @@ -23671,13 +23669,12 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
React.createElement(
"p",
{ style: { fontStyle: 'italic' } },
__('We strongly recommend to enable Google reCaptcha to avoid spam bot. You can enable it in Form Recaptcha in', 'advanced-gutenberg'),
__('We strongly recommend to enable Google reCAPTCHA to avoid spam.', 'advanced-gutenberg'),
React.createElement("br", null),
React.createElement(
"a",
{ href: advgbBlocks.config_url + '#email-form', target: "_blank" },
" ",
__('settings', 'advanced-gutenberg'),
"."
{ href: advgbBlocks.config_url + '&tab=recaptcha', target: "_blank" },
__('You can enable it in Settings', 'advanced-gutenberg')
)
)
),
Expand Down
6 changes: 3 additions & 3 deletions src/assets/blocks/contact-form/block.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@
{(typeof advgbBlocks !== 'undefined' && !parseInt(advgbBlocks.captchaEnabled)) && (
<PanelBody title={ __( 'Notice', 'advanced-gutenberg' ) }>
<p style={ { fontStyle: 'italic' } }>
{ __( 'We strongly recommend to enable Google reCaptcha to avoid spam bot. You can enable it in Form Recaptcha in', 'advanced-gutenberg' ) }
<a href={advgbBlocks.config_url + '#email-form'} target="_blank"> { __( 'settings', 'advanced-gutenberg' ) }.</a>
{ __( 'We strongly recommend to enable Google reCAPTCHA to avoid spam.', 'advanced-gutenberg' ) }
<br/><a href={advgbBlocks.config_url + '&tab=recaptcha'} target="_blank">{ __( 'You can enable it in Settings', 'advanced-gutenberg' ) }</a>
</p>
</PanelBody>
) }
<PanelBody title={ __( 'Email sender', 'advanced-gutenberg' ) } initialOpen={ false }>
<p style={ { fontStyle: 'italic' } }>
{ __('An email will be sent to the admin email (by default) whenever a contact form is submitted. You can change it in ', 'advanced-gutenberg') }
<a href={advgbBlocks.config_url + '#settings'} target="_blank"> { __( 'settings', 'advanced-gutenberg' ) }.</a>
<a href={advgbBlocks.config_url + '&tab=forms'} target="_blank"> { __( 'settings', 'advanced-gutenberg' ) }.</a>
</p>
</PanelBody>
<PanelBody title={ __( 'Text Label', 'advanced-gutenberg' ) }>
Expand Down
4 changes: 2 additions & 2 deletions src/assets/blocks/custom-styles.js

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

4 changes: 2 additions & 2 deletions src/assets/blocks/customstyles/custom-styles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
if (typeof advgbBlocks.customStyles !== 'undefined' && advgbBlocks.customStyles) {
advgbBlocks.customStyles.unshift( {
id: 0,
label: __( 'Select a custom style', 'advanced-gutenberg' ),
label: __( 'Select a block style', 'advanced-gutenberg' ),
value: '',
identifyColor: ''
} );
Expand All @@ -57,7 +57,7 @@
<div className="advgb-custom-styles-wrapper">
<SelectControl
label={ [
__( 'Custom styles', 'advanced-gutenberg' ),
__( 'Block styles', 'advanced-gutenberg' ),
<span className={'components-panel__color-area'}
key="customstyle-identify"
style={ {
Expand Down
6 changes: 3 additions & 3 deletions src/assets/blocks/login-form/block.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -739,9 +739,9 @@ import {AdvColorControl} from "../0-adv-components/components.jsx";
</PanelBody>
{(typeof advgbBlocks !== 'undefined' && !parseInt(advgbBlocks.captchaEnabled)) && (
<PanelBody title={ __( 'Notice', 'advanced-gutenberg' ) }>
<p style={ { fontStyle: 'italic', color: '#ff8800' } }>
{ __( 'We strongly recommend to enable Google reCaptcha to avoid spam bot. You can enable it in Form Recaptcha in', 'advanced-gutenberg' ) }
<a href={advgbBlocks.config_url + '#email-form'} target="_blank"> { __( 'settings', 'advanced-gutenberg' ) }.</a>
<p style={ { fontStyle: 'italic' } }>
{ __( 'We strongly recommend to enable Google reCAPTCHA to avoid spam.', 'advanced-gutenberg' ) }
<br/><a href={advgbBlocks.config_url + '&tab=recaptcha'} target="_blank">{ __( 'You can enable it in Settings', 'advanced-gutenberg' ) }</a>
</p>
</PanelBody>
) }
Expand Down
4 changes: 2 additions & 2 deletions src/assets/blocks/map/block.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1370,9 +1370,9 @@
>
<a target="_blank"
className="button button-large"
href={advgbBlocks.config_url + '#settings'}
href={advgbBlocks.config_url + '&tab=maps'}
>
{ __( 'Add Google API Key', 'advanced-gutenberg' ) }
{ __( 'Add Google API Key in Settings', 'advanced-gutenberg' ) }
</a>
</Placeholder>
}
Expand Down
4 changes: 2 additions & 2 deletions src/assets/blocks/newsletter/block.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
{(typeof advgbBlocks !== 'undefined' && !parseInt(advgbBlocks.captchaEnabled)) && (
<PanelBody title={ __( 'Notice', 'advanced-gutenberg' ) }>
<p style={ { fontStyle: 'italic' } }>
{ __( 'We strongly recommend to enable Google reCaptcha to avoid spam bot. You can enable it in Form Recaptcha in', 'advanced-gutenberg' ) }
<a href={advgbBlocks.config_url + '#email-form'} target="_blank"> { __( 'settings', 'advanced-gutenberg' ) }.</a>
{ __( 'We strongly recommend to enable Google reCAPTCHA to avoid spam.', 'advanced-gutenberg' ) }
<br/><a href={advgbBlocks.config_url + '&tab=recaptcha'} target="_blank">{ __( 'You can enable it in Settings', 'advanced-gutenberg' ) }</a>
</p>
</PanelBody>
) }
Expand Down
25 changes: 16 additions & 9 deletions src/incl/advanced-gutenberg-main.php
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ public function advgbBlocksVariables($post = true)
'login_logo' => $login_logo,
'reg_logo' => $reg_logo,
'home_url' => home_url(),
'config_url' => admin_url('admin.php?page=advgb_main'),
'config_url' => admin_url('admin.php?page=advgb_settings'),
'customStyles' => !$custom_styles_data ? array() : $custom_styles_data,
'captchaEnabled' => $recaptcha_config['recaptcha_enable'],
'pluginUrl' => plugins_url('', ADVANCED_GUTENBERG_PLUGIN),
Expand Down Expand Up @@ -794,6 +794,8 @@ public function upgradeProNotices()
if (
current_user_can( 'install_plugins' )
&& ! defined( 'ADVANCED_GUTENBERG_PRO' )
&& class_exists( 'PPVersionNotices\Module\TopNotice\Module' )
&& class_exists( 'PPVersionNotices\Module\MenuLink\Module' )
) {
// Top notice
add_filter(
Expand Down Expand Up @@ -1811,6 +1813,10 @@ public function subAdminPages()
*/
public function registerMainMenu()
{
if ( ! current_user_can( 'manage_options' ) ) {
return false;
}

global $submenu;

if ( empty( $GLOBALS['admin_page_hooks']['advgb_main'] ) ) {
Expand Down Expand Up @@ -1862,10 +1868,6 @@ public function registerMainMenu()
$submenu_slugs_conditions[] = [ $page['slug'], $page['enabled'] ];
}

/*echo '<pre>';
var_dump($submenu_slugs_conditions);
echo '</pre>';
exit;*/
foreach( $submenu['advgb_main'] as $key => $value ) {
if( in_array( $submenu['advgb_main'][$key][2], $submenu_slugs ) ) {
$slug_ = $submenu['advgb_main'][$key][2];
Expand All @@ -1881,7 +1883,6 @@ public function registerMainMenu()
$submenu['advgb_main'][$key][4] = $slug_ . '-menu-item' . $showHide;
}
}
//exit;
}
}

Expand Down Expand Up @@ -5568,9 +5569,15 @@ public function loadPageTab( $page, $tab, $default = 'general' )
if( file_exists( plugin_dir_path( __FILE__ ) . 'pages/' . $page . '/' . $tab . '.php' ) ) {
include_once( plugin_dir_path( __FILE__ ) . 'pages/' . $page . '/' . $tab . '.php' );
} else {
// Redirect to default page
wp_safe_redirect( admin_url( 'admin.php?page=advgb_settings' ) );
exit;
wp_add_inline_style(
'advgb_admin_styles',
'.publishpress-admin .nav-tab-wrapper { display: none !important; }'
);
printf(
__( 'Page not found. Go to %sDashboard%s', 'advanced-gutenberg' ),
'<a href="' . admin_url( 'admin.php?page=advgb_main' ) . '">',
'</a>'
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/languages/advanced-gutenberg-es_ES-editor.json

Large diffs are not rendered by default.

Binary file modified src/languages/advanced-gutenberg-es_ES.mo
Binary file not shown.
Loading

0 comments on commit 48962d3

Please sign in to comment.