Skip to content

Plugin Improvement #8074

@NenadObradovic

Description

@NenadObradovic

Hi Guys,

I have few suggestions:

  1. Inside main plugin file gutenberg.php could you set these labels to be translatable?
    add_menu_page( 'Gutenberg', 'Gutenberg', 'edit_posts', 'gutenberg', 'the_gutenberg_project', 'dashicons-edit' );
    to be
    add_menu_page( __( 'Gutenberg', 'gutenberg' ), __( 'Gutenberg', 'gutenberg' ), 'edit_posts', 'gutenberg', 'the_gutenberg_project', 'dashicons-edit' );

  2. Inside same file, I think better solution is to split code from text
    echo __( 'Gutenberg development mode requires files to be built. Run <code>npm install</code> to install dependencies, <code>npm run build</code> to build the files or <code>npm run dev</code> to build the files and watch for changes. Read the <a href="https://github.com/WordPress/gutenberg/blob/master/CONTRIBUTING.md">contributing</a> file for more information.', 'gutenberg' );
    to be
    echo sprintf( __( 'Gutenberg development mode requires files to be built. Run %s to install dependencies, %s to build the files or %s to build the files and watch for changes. Read the %s file for more information.', 'gutenberg' ), '<code>' . __( 'npm install', 'gutenberg' ) . '</code>', '<code>' . __( 'npm run build', 'gutenberg' ) . '</code>', '<code>' . __( 'npm run dev', 'gutenberg' ) . '</code>', '<a href="https://github.com/WordPress/gutenberg/blob/master/CONTRIBUTING.md">' . __( 'contributing', 'gutenberg' ) . '</a>' );

  3. Inside blocks.php file what you think to add filter hooks on several places where you return the value so developer can easily hooks your functions and modify for their purpose.

  4. Inside meta-box-partial-page.php I think you can escape the plugin name, because some plugin can cause error if they have special character
    printf( __( 'Gutenberg incompatible meta box, from the "%s" plugin.', 'gutenberg' ), $plugin['Name'] );
    for example to be
    printf( __( 'Gutenberg incompatible meta box, from the "%s" plugin.', 'gutenberg' ), esc_attr( $plugin['Name'] ) );

  5. I read several posts about incorrect order of hooks admin_enqueue_scripts and add_meta_boxes when gutenberg plugin is active, so I wonder if it will stay in reverse order or your working on that to find solution to set these actions in the default order? Because if it's stay I think it will be cool that you fill some notice or add in documentation as FAQ so that developers could add a conditional in their project when plugin is active to change order of inclusion.

In my case I have some function which dynamically register meta boxes and if my meta boxes exist at the end of that function I called admin_enqueue_scripts hook to include dynamically corresponding style for it, because of this situation scripts are not loaded.

Nenad

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] Help RequestHelp with setup, implementation, or "How do I?" questions.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions