diff --git a/optimwp.php b/optimwp.php index 1f808cd..41f5ae8 100644 --- a/optimwp.php +++ b/optimwp.php @@ -1,9 +1,9 @@ 1, 'optimwp_disable_file_editor'=> 1, 'optimwp_change_login_error'=> 1, + 'optimwp_remove_powered_by'=> 1, + 'optimwp_disable_auto_linking'=> 1, + 'optimwp_remove_capital'=> 1, 'optimwp_disable_post_revisions'=>[ '0'=> 'post', '1'=> 'page', @@ -79,6 +82,20 @@ function optimwp_plugin_action_links($links, $file) { return $links; } + function optimwp_plugin_row_meta( $links, $file ): array { + if ( plugin_basename( __FILE__ ) == $file ) { + $row_meta = [ + 'sponsor' => ' ' . esc_html__( 'Sponsor', 'optimwp' ) . '' + ]; + + return array_merge( $links, $row_meta ); + } + + return (array) $links; + } + + add_filter( 'plugin_row_meta', 'optimwp_plugin_row_meta', 10, 2 ); + // Add Menu To WordPress function optimwp_menu(): void { add_options_page('OptimWP Settings', 'OptimWP', 'manage_options', 'optimwp', 'optimwp_manage' ); @@ -87,7 +104,7 @@ function optimwp_menu(): void { // Plugin Management Page function optimwp_manage(): void{ - if( isset( $_POST["action"] ) && ( $_POST["action"] == "update" ) ){ + if( isset( $_POST['action'] ) && ( $_POST['action'] == 'update' ) ){ // Wp_nonce check if (!isset( $_POST['optimwp_update'] ) || ! wp_verify_nonce( $_POST['optimwp_update'], 'optimwp_update' ) ) { echo __('Sorry, you do not have access to this page!', 'optimwp'); @@ -117,7 +134,10 @@ function optimwp_manage(): void{ $optimwp_remove_shortlink = sanitize_text_field($_POST['optimwp_remove_shortlink']); $optimwp_disable_file_editor = sanitize_text_field($_POST['optimwp_disable_file_editor']); $optimwp_change_login_error = sanitize_text_field($_POST['optimwp_change_login_error']); + $optimwp_remove_powered_by = sanitize_text_field($_POST['optimwp_remove_powered_by']); $optimwp_remove_wlwmanifest_link = sanitize_text_field($_POST['optimwp_remove_wlwmanifest_link']); + $optimwp_disable_auto_linking = sanitize_text_field($_POST['optimwp_disable_auto_linking']); + $optimwp_remove_capital = sanitize_text_field($_POST['optimwp_remove_capital']); if(!isset($_POST['optimwp_disable_post_revisions'])){ $optimwp_disable_post_revisions =[]; }else{ @@ -149,6 +169,9 @@ function optimwp_manage(): void{ 'optimwp_remove_wlwmanifest_link'=> $optimwp_remove_wlwmanifest_link, 'optimwp_disable_file_editor'=> $optimwp_disable_file_editor, 'optimwp_change_login_error'=> $optimwp_change_login_error, + 'optimwp_remove_powered_by'=> $optimwp_remove_powered_by, + 'optimwp_disable_auto_linking'=> $optimwp_disable_auto_linking, + 'optimwp_remove_capital'=> $optimwp_remove_capital, 'optimwp_disable_post_revisions'=> $optimwp_disable_post_revisions ]; update_option('optimwp_options', $optimwp_options); @@ -158,8 +181,8 @@ function optimwp_manage(): void{ $my_options = get_option('optimwp_options'); ?>
- OptimWP Logo - + OptimWP Logo +
@@ -168,7 +191,7 @@ function optimwp_manage(): void{ @@ -178,7 +201,7 @@ function optimwp_manage(): void{ @@ -188,7 +211,7 @@ function optimwp_manage(): void{ @@ -198,7 +221,7 @@ function optimwp_manage(): void{ @@ -208,7 +231,7 @@ function optimwp_manage(): void{ @@ -218,7 +241,7 @@ function optimwp_manage(): void{ @@ -228,7 +251,7 @@ function optimwp_manage(): void{ @@ -238,7 +261,7 @@ function optimwp_manage(): void{ @@ -248,7 +271,7 @@ function optimwp_manage(): void{ @@ -258,7 +281,7 @@ function optimwp_manage(): void{ @@ -268,7 +291,7 @@ function optimwp_manage(): void{ @@ -278,7 +301,7 @@ function optimwp_manage(): void{ @@ -288,7 +311,7 @@ function optimwp_manage(): void{ @@ -298,7 +321,7 @@ function optimwp_manage(): void{ @@ -308,8 +331,8 @@ function optimwp_manage(): void{ @@ -318,7 +341,7 @@ function optimwp_manage(): void{ @@ -328,7 +351,7 @@ function optimwp_manage(): void{ @@ -338,7 +361,7 @@ function optimwp_manage(): void{ @@ -348,7 +371,7 @@ function optimwp_manage(): void{ @@ -358,7 +381,7 @@ function optimwp_manage(): void{ @@ -368,8 +391,8 @@ function optimwp_manage(): void{ @@ -378,8 +401,8 @@ function optimwp_manage(): void{ @@ -388,7 +411,7 @@ function optimwp_manage(): void{ @@ -398,7 +421,7 @@ function optimwp_manage(): void{ @@ -408,10 +431,40 @@ function optimwp_manage(): void{ + + + + + + + + + + + +