Get a reminder when you change your thumbnail sizes to regenerate them. Note Thumbnails sizes change automatically if you swtich themes.
Free$msg
", false ); } } } function nextgenthemes_get_products() { $products = array( 'arve_pro' => array( 'name' => 'ARVE Pro', 'id' => 1253, 'type' => 'plugin', 'author' => 'Nicolas Jonas', 'url' => 'https://nextgenthemes.com/plugins/arve-pro/', ), 'arve_amp' => array( 'name' => 'ARVE AMP', 'id' => 16941, 'type' => 'plugin', 'author' => 'Nicolas Jonas', 'url' => 'https://nextgenthemes.com/plugins/arve-amp/', ), 'arve_random_video' => array( 'name' => 'ARVE Random Video', 'id' => 31933, 'type' => 'plugin', 'author' => 'Nicolas Jonas', 'url' => 'https://nextgenthemes.com/plugins/arve-random-video/', ) ); $products = apply_filters( 'nextgenthemes_products', $products ); foreach ( $products as $key => $value ) { $products[ $key ]['slug'] = $key; $products[ $key ]['installed'] = false; $products[ $key ]['active'] = false; $products[ $key ]['valid_key'] = nextgenthemes_has_valid_key( $key ); $version_define = strtoupper( $key ) . '_VERSION'; $file_define = strtoupper( $key ) . '_FILE'; if( defined( $version_define ) ) { $products[ $key ]['version'] = constant( $version_define ); } if( defined( $file_define ) ) { $products[ $key ]['file'] = constant( $file_define ); } $version_define = "\\nextgenthemes\\$key\\VERSION"; $file_define = "\\nextgenthemes\\$key\\FILE"; if( defined( $version_define ) ) { $products[ $key ]['version'] = constant( $version_define ); } if( defined( $file_define ) ) { $products[ $key ]['file'] = constant( $file_define ); } if ( 'plugin' === $value['type'] ) { $file_slug = str_replace( '_', '-', $key ); $products[ $key ]['installed'] = nextgenthemes_is_plugin_installed( "$file_slug/$file_slug.php" ); $products[ $key ]['active'] = is_plugin_active( "$file_slug/$file_slug.php" ); } } return $products; } function nextgenthemes_is_plugin_installed( $plugin_basename ) { $plugins = get_plugins(); if( array_key_exists( $plugin_basename, $plugins ) ) { return true; } else { return false; } } /** * Register the administration menu for this plugin into the WordPress Dashboard menu. * * @since 1.0.0 */ function nextgenthemes_menus() { $plugin_screen_hook_suffix = add_options_page( __( 'ARVE Licenses', ARVE_SLUG ), __( 'ARVE Licenses', ARVE_SLUG ), 'manage_options', 'nextgenthemes-licenses', 'nextgenthemes_licenses_page' ); } function nextgenthemes_register_settings() { add_settings_section( 'keys', # id, __( 'Licenses', ARVE_SLUG ), # title, '__return_empty_string', # callback, 'nextgenthemes-licenses' # page ); foreach ( nextgenthemes_get_products() as $product_slug => $product ) : $option_basename = "nextgenthemes_{$product_slug}_key"; $option_keyname = $option_basename . '[key]'; add_settings_field( $option_keyname, # id, $product['name'], # title, 'nextgenthemes_key_callback', # callback, 'nextgenthemes-licenses', # page, 'keys', # section array( # args 'product' => $product, 'label_for' => $option_keyname, 'option_basename' => $option_basename, 'attr' => array( 'type' => 'text', 'id' => $option_keyname, 'name' => $option_keyname, 'class' => 'arve-license-input', 'value' => nextgenthemes_get_defined_key( $product_slug ) ? __( 'is defined (wp-config.php?)', ARVE_SLUG ) : nextgenthemes_get_key( $product_slug, 'option_only' ), ) ) ); register_setting( 'nextgenthemes', # option_group $option_basename, # option_name 'nextgenthemes_validate_license' # validation callback ); endforeach; } function nextgenthemes_key_callback( $args ) { echo ''; printf( '', arve_attr( array( 'type' => 'hidden', 'id' => $args['option_basename'] . '[product]', 'name' => $args['option_basename'] . '[product]', 'value' => $args['product']['slug'], ) ) ); printf( '', arve_attr( $args['attr'] ), nextgenthemes_get_defined_key( $args['product']['slug'] ) ? ' disabled' : '' ); $defined_key = nextgenthemes_get_defined_key( $args['product']['slug'] ); $key = nextgenthemes_get_key( $args['product']['slug'] ); if( $defined_key || ! empty( $key ) ) { submit_button( __('Activate License', ARVE_SLUG ), 'primary', $args['option_basename'] . '[activate_key]', false ); submit_button( __('Deactivate License', ARVE_SLUG ), 'secondary', $args['option_basename'] . '[deactivate_key]', false ); submit_button( __('Check License', ARVE_SLUG ), 'secondary', $args['option_basename'] . '[check_key]', false ); } echo '
'; echo ''; echo __( 'License Status: ', ARVE_SLUG ) . nextgenthemes_get_key_status( $args['product']['slug'] ); echo '
'; if( $args['product']['installed'] && ! $args['product']['active'] ) { printf( '%s', __( 'Plugin is installed but not activated', ARVE_SLUG ) ); } elseif( ! $args['product']['active'] ) { printf( '%s', arve_attr( array( 'href' => $args['product']['url'], 'class' => 'button button-primary', ) ), __( 'Not installed, check it out', ARVE_SLUG ) ); } } function nextgenthemes_validate_license( $input ) { if( ! is_array( $input ) ) { return sanitize_text_field( $input ); } $product = $input['product']; if ( $defined_key = nextgenthemes_get_defined_key( $product ) ) { $option_key = $key = $defined_key; } else { $key = sanitize_text_field( $input['key'] ); $option_key = nextgenthemes_get_key( $product ); } if( ( $key != $option_key ) || isset( $input['activate_key'] ) ) { nextgenthemes_api_update_key_status( $product, $key, 'activate' ); } elseif ( isset( $input['deactivate_key'] ) ) { nextgenthemes_api_update_key_status( $product, $key, 'deactivate' ); } elseif ( isset( $input['check_key'] ) ) { nextgenthemes_api_update_key_status( $product, $key, 'check' ); } return $key; } function nextgenthemes_get_key( $product, $option_only = false ) { if( ! $option_only && $defined_key = nextgenthemes_get_defined_key( $product ) ) { return $defined_key; } return get_option( "nextgenthemes_{$product}_key" ); } function nextgenthemes_get_key_status( $product ) { return get_option( "nextgenthemes_{$product}_key_status" ); } function nextgenthemes_update_key_status( $product, $key ) { update_option( "nextgenthemes_{$product}_key_status", $key ); } function nextgenthemes_has_valid_key( $product ) { return ( 'valid' === nextgenthemes_get_key_status( $product ) ) ? true : false; } function nextgenthemes_api_update_key_status( $product, $key, $action ) { $products = nextgenthemes_get_products(); $key_status = nextgenthemes_api_action( $products[ $product ]['id'], $key, $action ); nextgenthemes_update_key_status( $product, $key_status ); } function nextgenthemes_get_defined_key( $slug ) { $constant_name = str_replace( '-', '_', strtoupper( $slug . '_KEY' ) ); if( defined( $constant_name ) && constant( $constant_name ) ) { return constant( $constant_name ); } else { return false; } } function nextgenthemes_licenses_page() { ?>